WIP 1.51.13: kids check-in and volunteers on v2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { errorMessage } from "@/lib/utils";
|
||||
import { QrImage } from "@/components/shared/QrImage";
|
||||
import { Printer } from "lucide-react";
|
||||
import { checkInUrl } from "@/lib/volunteers";
|
||||
import { apiV2Data } from "@/lib/apiV2";
|
||||
|
||||
/** The event's volunteer check-in QR code, to show on a screen or print and put up at the venue. */
|
||||
export function CheckInQr({ token, eventId, title }: { token: string | null; eventId: string; title: string }) {
|
||||
@@ -15,7 +15,7 @@ export function CheckInQr({ token, eventId, title }: { token: string | null; eve
|
||||
useEffect(() => {
|
||||
if (!token || !eventId) return;
|
||||
setQr(null);
|
||||
apiFetch<{ qr: string }>(`/api/volunteers/manage/events/${eventId}/qr`, { authToken: token })
|
||||
(apiV2Data("get", "/events/{id}/volunteers/qr", { params: { id: eventId }, authToken: token }) as Promise<{ qr: string }>)
|
||||
.then(r => setQr(r.qr))
|
||||
.catch(e => setError(errorMessage(e) || "Could not load the QR code"));
|
||||
}, [token, eventId]);
|
||||
|
||||
Reference in New Issue
Block a user