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:
@@ -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: [] };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user