WIP 1.51.8: frontend on v2 for event detail, options, sections, attachments, costs, uploads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
@@ -216,6 +216,17 @@ export async function fetchManagedEvents<T = Event>(token: string | null | undef
|
||||
return data as unknown as T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* One event in full (API v2 GET /events/{id}/full): ticket options with what's left, sessions,
|
||||
* form, attachments, bundles. Staff signed in (`authToken`) also see inactive and not-yet-live
|
||||
* events; `nextOptions` passes Next.js caching (e.g. revalidate) through for server pages.
|
||||
*/
|
||||
export async function fetchEvent<T = Event>(id: string, options: { authToken?: string | null; nextOptions?: RequestInit } = {}): Promise<T> {
|
||||
const { apiV2 } = await import("@/lib/apiV2");
|
||||
const { data } = await apiV2("get", "/events/{id}/full", { params: { id }, authToken: options.authToken, nextOptions: options.nextOptions });
|
||||
return data as unknown as T;
|
||||
}
|
||||
|
||||
export function fetchAllUsers(token: string, params: Record<string, string> = {}): Promise<User[]> {
|
||||
return fetchAllPages<User>("/api/users", token, params);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user