Spaces:
Sleeping
Sleeping
total count potholes images and videos
Browse files
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 |
-
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|