From 69884ba519cb826f8b4f5415bd196058ad75547f Mon Sep 17 00:00:00 2001 From: rohitkphilip Date: Thu, 15 Aug 2024 20:23:16 -0700 Subject: [PATCH 1/2] minor fix in /properties - GET --- properties.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/properties.py b/properties.py index b9fd483..262ef7a 100644 --- a/properties.py +++ b/properties.py @@ -523,7 +523,7 @@ def get(self, uid): ) AS appliances FROM space.properties p LEFT JOIN space.appliances a ON p.property_uid = a.appliance_property_id - WHERE property_uid = '200-000001' + WHERE property_uid = \'""" + uid + """\' GROUP BY p.property_uid; """) response["Property"] = propertiesQuery From 0cf16547166e60ff6116191e41fe2cda1ee8a130 Mon Sep 17 00:00:00 2001 From: rohitkphilip Date: Thu, 15 Aug 2024 21:04:04 -0700 Subject: [PATCH 2/2] fixed /properties - GET --- properties.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/properties.py b/properties.py index 262ef7a..4e7749f 100644 --- a/properties.py +++ b/properties.py @@ -501,28 +501,8 @@ def get(self, uid): print("In Find Property with Appliances") propertiesQuery = db.execute(""" -- RETURN PROPERTIES WITH APPLIANCES - SELECT p.*, - JSON_ARRAYAGG( - JSON_OBJECT( - 'appliance_uid', a.appliance_uid, - 'appliance_property_id', a.appliance_property_id, - 'appliance_type', a.appliance_type, - 'appliance_url', a.appliance_url, - 'appliance_images', a.appliance_images, - 'appliance_available', a.appliance_available, - 'appliance_installed', a.appliance_installed, - 'appliance_model_num', a.appliance_model_num, - 'appliance_purchased', a.appliance_purchased, - 'appliance_serial_num', a.appliance_serial_num, - 'appliance_manufacturer', a.appliance_manufacturer, - 'appliance_warranty_info', a.appliance_warranty_info, - 'appliance_warranty_till', a.appliance_warranty_till, - 'appliance_purchased_from', a.appliance_purchased_from, - 'appliance_purchase_order', a.appliance_purchase_order - ) - ) AS appliances - FROM space.properties p - LEFT JOIN space.appliances a ON p.property_uid = a.appliance_property_id + SELECT * + FROM space.p_details AS p WHERE property_uid = \'""" + uid + """\' GROUP BY p.property_uid; """)