fix: dashboard counters refresh after status changes

When a booking status is changed, confirmed, or deleted in any tab,
the dashboard summary cards re-fetch to show updated counts. Previously
the dashboard was stale until page reload.
This commit is contained in:
2026-03-24 17:52:21 +03:00
parent 83456c6e9d
commit aa07b64c80
4 changed files with 17 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ interface McRegistration extends BaseBooking {
interface McSlot { date: string; startTime: string }
interface McItem { title: string; slots: McSlot[] }
export function McRegistrationsTab({ filter }: { filter: BookingFilter }) {
export function McRegistrationsTab({ filter, onDataChange }: { filter: BookingFilter; onDataChange?: () => void }) {
const [regs, setRegs] = useState<McRegistration[]>([]);
const [mcDates, setMcDates] = useState<Record<string, string>>({});
const [loading, setLoading] = useState(true);
@@ -75,6 +75,7 @@ export function McRegistrationsTab({ filter }: { filter: BookingFilter }) {
endpoint="/api/admin/mc-registrations"
filter={filter}
onItemsChange={setRegs}
onDataChange={onDataChange}
groups={groups}
/>
);