| @@ -395,16 +395,24 @@ | ||
| 395 | 395 | queryKey: ["dashboard-upcoming-departures"], |
| 396 | 396 | queryFn: async () => { |
| 397 | 397 | const today = new Date(); |
| 398 | 398 | const todayStr = formatDateForInput(today); |
| 399 | + // Fetch all FUTURE departures, not only status === "upcoming". A departure | |
| 400 | + // that a booking has filled flips to status "full" (booked >= capacity), | |
| 401 | + // and a single group-of-x booking fills a small/private departure in one | |
| 402 | + // go — so filtering to "upcoming" here silently dropped fully-booked | |
| 403 | + // upcoming tours from the dashboard while partially-booked ones stayed. We | |
| 404 | + // keep upcoming + full (a full trip is still an upcoming trip, just sold | |
| 405 | + // out) and exclude only cancelled/trash/past. | |
| 399 | 406 | const response = await apiClient.get("/departures", { |
| 400 | 407 | params: { |
| 401 | - status: "upcoming", | |
| 402 | 408 | date_from: todayStr, |
| 403 | 409 | include_past: false, |
| 404 | 410 | }, |
| 405 | 411 | }); |
| 406 | - const items = response?.data || []; | |
| 412 | + const items = (response?.data || []).filter( | |
| 413 | + (d: any) => d?.status === "upcoming" || d?.status === "full", | |
| 414 | + ); | |
| 407 | 415 | return items.map((d: any) => { |
| 408 | 416 | const tripTitle = d?.trip?.title || d?.trip_title || d?.title || ""; |
| 409 | 417 | const destination = |
| 410 | 418 | (d?.trip?.destinations && d.trip.destinations[0]?.name) || |