WIP 1.51.11: money on v2 via v1 handlers (viaV1 adapter)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls1vMdg2GYqbnKZmPaX1ot
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { apiFetch } from "@/lib/api";
|
||||
import { apiV2Data } from "@/lib/apiV2";
|
||||
|
||||
type ProvidersResponse = { providers: { id: string; label: string }[]; minimumAmount: number };
|
||||
|
||||
@@ -21,7 +21,7 @@ export type OnlinePayments = {
|
||||
// One request per page load, shared by every component that asks.
|
||||
let pending: Promise<ProvidersResponse | null> | null = null;
|
||||
function load() {
|
||||
if (!pending) pending = apiFetch<ProvidersResponse>("/api/payments/providers").catch(() => null);
|
||||
if (!pending) pending = (apiV2Data("get", "/payments/providers") as Promise<ProvidersResponse>).catch(() => null);
|
||||
return pending;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user