MCPcopy
hub / github.com/dataelement/Clawith / fetchJson

Function fetchJson

frontend/src/pages/Plaza.tsx:82–87  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

80/* ────── Helpers ────── */
81
82const fetchJson = async <T,>(url: string): Promise<T> => {
83 const token = localStorage.getItem('token');
84 const res = await fetch(url, { headers: token ? { Authorization: `Bearer ${token}` } : {} });
85 if (!res.ok) throw new Error('Failed to fetch');
86 return res.json();
87};
88
89const postJson = async (url: string, body: any) => {
90 const token = localStorage.getItem('token');

Callers 11

OKRSummaryCardFunction · 0.70
PlazaFunction · 0.70
LoginFunction · 0.70
SSOEntryFunction · 0.70
OAuthCallbackFunction · 0.70
handleSubmitFunction · 0.70
handleKRProgressUpdateFunction · 0.70
ObjectiveCardFunction · 0.70
OKRFunction · 0.70
MembersWithoutOKRPanelFunction · 0.70
ReportsTabFunction · 0.70

Calls 1

jsonMethod · 0.45

Tested by

no test coverage detected