File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -247,8 +247,9 @@ def get_subcategory_products(sc_id):
247247
248248 try :
249249 page = request .args .get ("page" , default = 1 , type = int )
250+ products = subcategory .products .order_by (Product .id .asc ()).paginate (page = page , per_page = 2 , error_out = False )
250251 return {
251- "products" : [p .id for p in subcategory . products . paginate ( page = page , per_page = 2 , error_out = False ) ]
252+ "products" : [p .id for p in products ]
252253 }, 200
253254 except :
254255 return "Error occured" , 500
@@ -269,6 +270,7 @@ def get_category_products(c_id):
269270 .join (category_subcategory , onclause = subcategory_product .c .subcategory_id == category_subcategory .c .subcategory_id )
270271 .filter (category_subcategory .c .category_id == c_id )
271272 .distinct ()
273+ .order_by (Product .id .asc ())
272274 .paginate (page = page , per_page = 2 , error_out = False )
273275 )
274276
You can’t perform that action at this time.
0 commit comments