Skip to content

Commit a85be4e

Browse files
return full product details
1 parent 06f6056 commit a85be4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def get_category_products(c_id):
264264
)
265265

266266
return {
267-
"products": [p.id for p in products]
267+
"products": [p.to_json() for p in products]
268268
}, 200
269269
except:
270270
return "Error occured", 500
@@ -538,7 +538,7 @@ def get_subcategory_products(sc_id):
538538
page = request.args.get("page", default=1, type=int)
539539
products = subcategory.products.order_by(Product.id.asc()).paginate(page=page, per_page=2, error_out=False)
540540
return {
541-
"products": [p.id for p in products]
541+
"products": [p.to_json() for p in products]
542542
}, 200
543543
except:
544544
return "Error occured", 500

0 commit comments

Comments
 (0)