Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ supabase: Client = create_client(url, key)
|
|
| 18 |
|
| 19 |
@app.get('/insurance_data')
|
| 20 |
async def get_insurance_data(hushh_id:str):
|
| 21 |
-
response = supabase.table('receipt_radar_structured_data_duplicate').select('metadata,message_id').eq("user_id",hushh_id).eq("brand_category",'Insurance').execute()
|
| 22 |
resp = response.data
|
| 23 |
res = {}
|
| 24 |
print(resp)
|
|
@@ -29,7 +29,7 @@ async def get_insurance_data(hushh_id:str):
|
|
| 29 |
if ds.get('insurance_type') is not None and ds.get('insurance_type') != "" and ds.get('policy_details') is not None and ds.get('coverage_details') is not None:
|
| 30 |
if ds.get('insurance_type') not in res:
|
| 31 |
res[ds.get('insurance_type')] = []
|
| 32 |
-
res[ds.get('insurance_type')].append({"message_id":message_id,"policy_details":ds.get('policy_details') ,"coverage_details": ds.get('coverage_details')})
|
| 33 |
return res
|
| 34 |
|
| 35 |
|
|
|
|
| 18 |
|
| 19 |
@app.get('/insurance_data')
|
| 20 |
async def get_insurance_data(hushh_id:str):
|
| 21 |
+
response = supabase.table('receipt_radar_structured_data_duplicate').select('metadata,message_id,company,logo').eq("user_id",hushh_id).eq("brand_category",'Insurance').execute()
|
| 22 |
resp = response.data
|
| 23 |
res = {}
|
| 24 |
print(resp)
|
|
|
|
| 29 |
if ds.get('insurance_type') is not None and ds.get('insurance_type') != "" and ds.get('policy_details') is not None and ds.get('coverage_details') is not None:
|
| 30 |
if ds.get('insurance_type') not in res:
|
| 31 |
res[ds.get('insurance_type')] = []
|
| 32 |
+
res[ds.get('insurance_type')].append({"message_id":message_id,"policy_details":ds.get('policy_details') ,"coverage_details": ds.get('coverage_details'),"domain":msg.get('company'),"logo":msg.get('logo')})
|
| 33 |
return res
|
| 34 |
|
| 35 |
|