Archived
WIP 1.51.12: tickets, scan locks, attendance, allocations 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:
@@ -3,10 +3,10 @@ import React, { useEffect, useState } from "react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { Navbar } from "@/components/layout/Navbar";
|
||||
import { Footer } from "@/components/layout/Footer";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { formatDate } from "@/lib/date";
|
||||
import { Ticket, CheckCircle2, XCircle } from "lucide-react";
|
||||
import { errorMessage } from "@/lib/utils";
|
||||
import { apiV2Data } from "@/lib/apiV2";
|
||||
|
||||
type Offer = {
|
||||
status: "pending" | "accepted" | "declined" | "cancelled" | "expired";
|
||||
@@ -36,7 +36,7 @@ export default function TransferOfferPage() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!token) return;
|
||||
apiFetch<Offer>(`/api/tickets/transfer-offer/${encodeURIComponent(token)}`)
|
||||
(apiV2Data("get", "/ticket-transfers/{token}", { params: { token: token } }) as Promise<Offer>)
|
||||
.then(setOffer)
|
||||
.catch(e => setLoadError(e?.message || "This transfer link isn't valid."));
|
||||
}, [token]);
|
||||
@@ -45,7 +45,7 @@ export default function TransferOfferPage() {
|
||||
setBusy(true);
|
||||
setError(null);
|
||||
try {
|
||||
const r = await apiFetch<{ message: string }>(`/api/tickets/transfer-offer/${encodeURIComponent(token!)}/${action}`, { method: "POST" });
|
||||
const r = await (apiV2Data("post", action === "accept" ? "/ticket-transfers/{token}/accept" : "/ticket-transfers/{token}/decline", { params: { token: token! }, body: {} }) as Promise<{ message: string }>);
|
||||
setDone({ ok: action === "accept", message: r.message });
|
||||
} catch (e) {
|
||||
setError(errorMessage(e) || "Something went wrong");
|
||||
|
||||
Reference in New Issue
Block a user