Skip to content

Commit c83dea3

Browse files
Change page size to 10
1 parent 0bb647c commit c83dea3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def get_category_products(c_id):
260260
.filter(category_subcategory.c.category_id == c_id)
261261
.distinct()
262262
.order_by(Product.id.asc())
263-
.paginate(page=page, per_page=2, error_out=False)
263+
.paginate(page=page, per_page=10, error_out=False)
264264
)
265265

266266
return {
@@ -536,7 +536,7 @@ def get_subcategory_products(sc_id):
536536

537537
try:
538538
page = request.args.get("page", default=1, type=int)
539-
products = subcategory.products.order_by(Product.id.asc()).paginate(page=page, per_page=2, error_out=False)
539+
products = subcategory.products.order_by(Product.id.asc()).paginate(page=page, per_page=10, error_out=False)
540540
return {
541541
"products": [p.to_json() for p in products]
542542
}, 200
@@ -776,7 +776,7 @@ def get_all_products():
776776
description: A list of products for that page.
777777
"""
778778
page = request.args.get("page", default=1, type=int)
779-
products = Product.query.order_by(Product.id.asc()).paginate(page=page, per_page=2, error_out=False)
779+
products = Product.query.order_by(Product.id.asc()).paginate(page=page, per_page=10, error_out=False)
780780
return jsonify({"products": [product.to_json() for product in products]}), 200
781781

782782

0 commit comments

Comments
 (0)