@@ -45,19 +45,20 @@ async def all_categories(**kwargs):
4545 language : Language = kwargs .get ("language" )
4646 state_data = await state .get_data ()
4747 if callback_data .is_filter_enabled and state_data .get ('filter' ) is not None :
48- msg , kb_builder = await CategoryService .get_buttons (callback_data , state , session , language )
48+ media , kb_builder = await CategoryService .get_buttons (callback_data , state , session , language )
4949 elif callback_data .is_filter_enabled :
50- msg , kb_builder = await enable_search (callback_data ,
50+ item_type_value = callback_data .item_type .value if callback_data .item_type else None
51+ media , kb_builder = await enable_search (callback_data ,
5152 EntityType .CATEGORY ,
52- {"item_type" : callback_data . item_type . value },
53+ {"item_type" : item_type_value },
5354 state ,
5455 UserStates .filter_items ,
5556 language )
5657 else :
5758 await state .update_data (filter = None )
5859 await state .set_state ()
59- msg , kb_builder = await CategoryService .get_buttons (callback_data , state , session , language )
60- await callback .message .edit_caption ( caption = msg , reply_markup = kb_builder .as_markup ())
60+ media , kb_builder = await CategoryService .get_buttons (callback_data , state , session , language )
61+ await callback .message .edit_media ( media = media , reply_markup = kb_builder .as_markup ())
6162
6263
6364async def show_subcategories_in_category (** kwargs ):
@@ -70,10 +71,11 @@ async def show_subcategories_in_category(**kwargs):
7071 if callback_data .is_filter_enabled and state_data .get ('filter' ) is not None :
7172 media , kb_builder = await SubcategoryService .get_buttons (callback_data , state , session , language )
7273 elif callback_data .is_filter_enabled :
74+ item_type_value = callback_data .item_type .value if callback_data .item_type else None
7375 media , kb_builder = await enable_search (callback_data ,
7476 EntityType .SUBCATEGORY ,
7577 {"category_id" : callback_data .category_id ,
76- "item_type" : callback_data . item_type . value },
78+ "item_type" : item_type_value },
7779 state ,
7880 UserStates .filter_items ,
7981 language )
0 commit comments