WIP 1.51.9: frontend on v2 for series, passes, bundles, coupons, campuses

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
2026-10-29 12:34:49 +02:00
co-authored by Claude Opus 5.5
parent d6082693c2
commit 733b23955b
18 changed files with 81 additions and 58 deletions
@@ -2,14 +2,14 @@
import React, { useEffect, useState } from "react";
import { Gift } from "lucide-react";
import { apiFetch } from "@/lib/api";
import type { BundleItem, BundleQuote, PublicBundle } from "@/types";
import type { BasketItem } from "@/components/shared/CouponCodeField";
import { apiV2Data } from "@/lib/apiV2";
const fmt = (n: number) => `R${n.toFixed(2)}`;
/**
* The bundle deals a basket gets, from POST /api/bundles/quote (the server prices the
* The bundle deals a basket gets, from POST /api/v2/bundles/quote (the server prices the
* basket the same way registration will). Null while there's nothing to show. Pass
* `enabled={false}` when the event has no bundles to skip the request.
*
@@ -35,7 +35,7 @@ export function useBundleQuote({ eventId, basket, token, forUserId, enabled = tr
try {
const body: Record<string, unknown> = { eventId, options };
if (forUserId !== undefined) body.forUserId = forUserId;
const res = await apiFetch<BundleQuote>("/api/bundles/quote", { method: "POST", authToken: token || undefined, body });
const res = await (apiV2Data("post", "/bundles/quote", { authToken: token, body: body as never }) as Promise<BundleQuote>);
if (!cancelled) setQuote(res.bundleDiscount > 0 ? res : null);
} catch {
if (!cancelled) setQuote(null);