sunilchm commited on
Commit
df0ebd8
·
1 Parent(s): e8b090c

total count potholes images and videos

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -137,8 +137,12 @@ async def get_detailed_report_data(category: str = Query(...)):
137
  async def get_pothole_reports():
138
  try:
139
  # Fetch all pothole reports
140
- reports_response = supabase.table("potholes").select("*").eq("category", "potholes").execute()
141
- return reports_response.data
 
 
 
 
142
  except Exception as e:
143
  raise HTTPException(status_code=500, detail=f"Database error: {str(e)}")
144
 
 
137
  async def get_pothole_reports():
138
  try:
139
  # Fetch all pothole reports
140
+ reports_potholes_response = supabase.table("potholes").select("*").eq("category", "potholes").execute()
141
+
142
+ # Fetch all videos reports
143
+ reports_videos_response = supabase.table("videos")..select("*").eq("category", "potholes").execute()
144
+
145
+ return reports_potholes_response.data + reports_videos_response.data
146
  except Exception as e:
147
  raise HTTPException(status_code=500, detail=f"Database error: {str(e)}")
148