Update guest v2 branding and theming
This commit is contained in:
19
resources/js/guest-v2/services/qrApi.ts
Normal file
19
resources/js/guest-v2/services/qrApi.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { fetchJson } from './apiClient';
|
||||
|
||||
export type EventQrCodePayload = {
|
||||
url?: string | null;
|
||||
qr_code_data_url?: string | null;
|
||||
};
|
||||
|
||||
export async function fetchEventQrCode(eventToken: string, size = 240): Promise<EventQrCodePayload> {
|
||||
const params = new URLSearchParams();
|
||||
if (Number.isFinite(size)) {
|
||||
params.set('size', String(size));
|
||||
}
|
||||
const query = params.toString();
|
||||
const url = `/api/v1/events/${encodeURIComponent(eventToken)}/qr${query ? `?${query}` : ''}`;
|
||||
|
||||
const response = await fetchJson<EventQrCodePayload>(url, { noStore: true });
|
||||
|
||||
return response.data ?? { url: null, qr_code_data_url: null };
|
||||
}
|
||||
Reference in New Issue
Block a user