MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / tryClaimInviteCode

Function tryClaimInviteCode

frontend-workflow/src/stores/authStore.ts:64–78  ·  view source on GitHub ↗
(inviteCode: string)

Source from the content-addressed store, hash-verified

62}
63
64async function tryClaimInviteCode(inviteCode: string): Promise<void> {
65 const response = await backendFetch("/api/v1/account/invite/claim", {
66 method: "POST",
67 headers: {
68 "Content-Type": "application/json",
69 },
70 body: JSON.stringify({ invite_code: inviteCode }),
71 });
72
73 const data = await response.json().catch(() => null);
74 if (!response.ok) {
75 const detail = data?.detail || "邀请码兑换失败,请稍后重试";
76 throw new Error(detail);
77 }
78}
79
80// Note: We use relative paths ("/api/...") which go through Vite proxy in dev mode
81// This allows the backend URL to be configured at proxy level, not hardcoded here

Callers 1

authStore.tsFile · 0.85

Calls 2

backendFetchFunction · 0.90
jsonMethod · 0.80

Tested by

no test coverage detected