Bookings display issue #3739
2 changed files+11−4
Modifiedbackend/booking_routes.py+9−2View fileUnifiedSplit
@@ -1046,8 +1046,10 @@ async def delete_seo_page(page_slug: str):
10461046async def get_all_bookings():
10471047 try:
10481048 bookings = await db.bookings.find({}, {"_id": 0}).sort("createdAt", -1).to_list(1000)
1049 logger.info(f"GET /bookings returned {len(bookings)} bookings (db={os.environ.get('DB_NAME', 'unknown')})")
10491050 return bookings
10501051 except Exception as e:
1052 logger.error(f"GET /bookings failed: {str(e)}")
10511053 raise HTTPException(status_code=500, detail=str(e))
10521054
10531055
@@ -3468,9 +3470,11 @@ async def health():
34683470 # If DB is reachable, this should not throw
34693471 ok_db = True
34703472 err = None
3473 booking_count = 0
3474 deleted_count = 0
34713475 try:
3472 # lightweight ping: count 0/1 doc
3473 await db.bookings.count_documents({}, limit=1)
3476 booking_count = await db.bookings.count_documents({})
3477 deleted_count = await db.deleted_bookings.count_documents({})
34743478 except Exception as e:
34753479 ok_db = False
34763480 err = str(e)
@@ -3478,6 +3482,9 @@ async def health():
34783482 "ok": True,
34793483 "service": "hibiscus-backend",
34803484 "db_ok": ok_db,
3485 "db_name": os.environ.get('DB_NAME', '(not set)'),
3486 "booking_count": booking_count,
3487 "deleted_count": deleted_count,
34813488 "db_error": err,
34823489 "ts": datetime.now(timezone.utc).isoformat()
34833490 }
Modifiedfrontend/src/config.js+2−2View fileUnifiedSplit
@@ -1,4 +1,4 @@
11// Centralized backend URL configuration
2// Falls back to the known Render deployment if REACT_APP_BACKEND_URL is not set.
2// Falls back to the production API domain if REACT_APP_BACKEND_URL is not set.
33export const BACKEND_URL =
4 process.env.REACT_APP_BACKEND_URL || 'https://hibiscus-to-airport-1.onrender.com';
4 process.env.REACT_APP_BACKEND_URL || 'https://api.hibiscustoairport.co.nz';
55
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts