Skip to content

Commit 10c8f17

Browse files
return empty array when products end instead of error
1 parent 77ad158 commit 10c8f17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def get_subcategory_products(sc_id):
250250
try:
251251
page = request.args.get("page", default=1, type=int)
252252
return {
253-
"products": [p.id for p in subcategory.products.paginate(page=page, per_page=2)]
253+
"products": [p.id for p in subcategory.products.paginate(page=page, per_page=2, error_out=False)]
254254
}, 200
255255
except:
256256
return "Error occured", 500

0 commit comments

Comments
 (0)