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:
2026-10-21 11:10:01 +02:00
co-authored by Claude Opus 5.5
parent 5024ab7241
commit dc4d2fff41
32 changed files with 375 additions and 175 deletions
+3 -3
View File
@@ -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