From 5a8ca672b7928a9b0f60b626711ae30ae6f6d180 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 25 Jun 2025 12:10:27 -0400 Subject: [PATCH] products_data --- app/api/services/products.py | 18 ++++++++++++++++-- app/models/products.py | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/api/services/products.py b/app/api/services/products.py index d4a4d06..9b5113d 100644 --- a/app/api/services/products.py +++ b/app/api/services/products.py @@ -59,11 +59,25 @@ class ProductsService(BaseService): # data = db.session.execute(PRODUCT_LIST) products_data = Products.get_user_product_list(member_id) - logger.error(f"Product Data ****** *****: {products_data}") + logger.info(f"Product Data ****** *****: {products_data}") + + products_data = [{ + 'id': t.id, + 'uid': t.uid, + 'product_id': t.product_id, + 'description': t.description, + 'name': t.name, + 'status': t.status, + 'created_at': t.created_at.isoformat() if t.created_at else None, + 'updated_at': t.updated_at.isoformat() if t.updated_at else None, + 'banner': t.banner, + } for t in products] + # Simulate processing response_data = { - "products_data": data, + "products_data": products.to_dict(), + "products_data22": products_data, "member_id": 0, "uid": 0, } diff --git a/app/models/products.py b/app/models/products.py index 2b30a3f..98f2e28 100644 --- a/app/models/products.py +++ b/app/models/products.py @@ -73,8 +73,8 @@ class Products(db.Model): 'id': self.id, 'uid': self.uid, 'product_id': self.product_id, - 'productId': self.product_id, 'name': self.name, + 'description' : self.description, 'status': self.status, 'added': self.added, 'updated': self.updated,