MCPcopy
hub / github.com/7836246/cursor2api / saveConfig

Function saveConfig

vue-ui/src/api.ts:54–67  ·  view source on GitHub ↗
(cfg: Partial<HotConfig>)

Source from the content-addressed store, hash-verified

52}
53
54export async function saveConfig(cfg: Partial<HotConfig>): Promise<SaveConfigResult> {
55 const res = await fetch('/api/config', {
56 method: 'POST',
57 headers: { 'Content-Type': 'application/json', ...getAuthHeader() },
58 body: JSON.stringify(cfg),
59 });
60 if (res.status === 401) {
61 const pinia = getActivePinia();
62 if (pinia) useAuthStore(pinia).logout();
63 throw new Error('HTTP 401');
64 }
65 if (!res.ok) throw new Error(`HTTP ${res.status}`);
66 return res.json() as Promise<SaveConfigResult>;
67}
68
69export interface RequestsPage {
70 summaries: RequestSummary[];

Callers 1

saveFunction · 0.90

Calls 2

getAuthHeaderFunction · 0.85
jsonMethod · 0.45

Tested by

no test coverage detected