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('/get_travel_data')
|
20 |
async def get_user_travel_data(hushh_id:str):
|
21 |
-
resp = supabase.table("receipt_radar_structured_data_duplicate").select("metadata").eq("brand_category","Travel").execute()
|
22 |
print(resp.data)
|
23 |
data = {}
|
24 |
arrival_location_frequency = {}
|
@@ -34,7 +34,7 @@ async def get_user_travel_data(hushh_id:str):
|
|
34 |
arrival_city = ds.get('arrival_city') if ds.get('arrival_city') is not None else None
|
35 |
if 'travel_history' not in data:
|
36 |
data['travel_history'] = []
|
37 |
-
data['travel_history'].append({'arrival_date':arrival_date,'travel_type':travel_type,'departure_destination':departure_destination,'arrival_destination':arrival_destination})
|
38 |
print('Data')
|
39 |
print(data)
|
40 |
# Increment arrival_location_frequency count for the current arrival_destination
|
|
|
18 |
|
19 |
@app.get('/get_travel_data')
|
20 |
async def get_user_travel_data(hushh_id:str):
|
21 |
+
resp = supabase.table("receipt_radar_structured_data_duplicate").select("metadata,message_id").eq("brand_category","Travel").execute()
|
22 |
print(resp.data)
|
23 |
data = {}
|
24 |
arrival_location_frequency = {}
|
|
|
34 |
arrival_city = ds.get('arrival_city') if ds.get('arrival_city') is not None else None
|
35 |
if 'travel_history' not in data:
|
36 |
data['travel_history'] = []
|
37 |
+
data['travel_history'].append({"message_id":msg.get('message_id'),'arrival_date':arrival_date,'travel_type':travel_type,'departure_destination':departure_destination,'arrival_destination':arrival_destination})
|
38 |
print('Data')
|
39 |
print(data)
|
40 |
# Increment arrival_location_frequency count for the current arrival_destination
|