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 0498ee1854
commit 684560119f
18 changed files with 81 additions and 58 deletions
@@ -1,8 +1,8 @@
"use client";
import { useEffect, useState } from "react";
import { apiFetch } from "@/lib/api";
import { useAuth } from "@/hooks/useAuth";
import { apiV2Data } from "@/lib/apiV2";
export type Campus = {
id: string;
@@ -28,7 +28,7 @@ let cache: Promise<CampusState> | null = null;
function load(): Promise<CampusState> {
if (!cache) {
cache = apiFetch<CampusState>("/api/campuses").catch(() => {
cache = (apiV2Data("get", "/campuses") as Promise<CampusState>).catch(() => {
cache = null; // try again next time
return { enabled: false, campuses: [] };
});