diff --git a/flaskshop/public/search.py b/flaskshop/public/search.py index 11306466..2dbae689 100644 --- a/flaskshop/public/search.py +++ b/flaskshop/public/search.py @@ -15,7 +15,7 @@ def get_item_data(item): return { - "id": item.id, + "meta": {"id": item.id}, "title": item.title, "description": item.description, "first_img": item.first_img, @@ -110,6 +110,7 @@ def __init__(self, page, per_page, **kwargs): def _query_items(self): for item in self.rs: + item.id = item.meta.id item.first_img = ProductImage.query.filter(ProductImage.product_id == item.id).first() return self.rs