Add shared API types and type the smaller frontend pages
Expand src/types with User, Event, EventOption, Registration, Payment, Ticket, paginated results and dashboard stats, modelled on the Prisma schema. apiFetch now defaults to unknown instead of any. Dashboard loaders are wrapped in useCallback so their effects can list them as dependencies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,7 @@ function addToast(toast: ToastInput) {
|
||||
const newToast: Toast = {
|
||||
...toast,
|
||||
id,
|
||||
open: true as any,
|
||||
open: true,
|
||||
}
|
||||
|
||||
// Ensure limit
|
||||
@@ -62,11 +62,11 @@ function updateToast(id: string, update: Partial<Toast>) {
|
||||
function dismissToast(id?: string) {
|
||||
if (id) {
|
||||
queueRemoval(id)
|
||||
updateToast(id, { open: false } as any)
|
||||
updateToast(id, { open: false })
|
||||
} else {
|
||||
state.toasts.forEach((t) => {
|
||||
queueRemoval(t.id)
|
||||
updateToast(t.id, { open: false } as any)
|
||||
updateToast(t.id, { open: false })
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export function useQRScanner(videoEl: HTMLVideoElement | null, opts: UseQRScanne
|
||||
try {
|
||||
if (!videoEl) return;
|
||||
const result = await reader.decodeOnceFromVideoElement(videoEl);
|
||||
const text = (result as any)?.getText ? (result as any).getText() : (result as any)?.text ?? String(result ?? "");
|
||||
const text = result?.getText() ?? "";
|
||||
if (text) onResult?.(text);
|
||||
} catch {
|
||||
// Ignore transient decode errors and retry
|
||||
|
||||
Reference in New Issue
Block a user