Profile saving works

This commit is contained in:
AG
2025-11-20 22:56:38 +02:00
parent 17ae81d5d9
commit 84417847fd
6 changed files with 39 additions and 11 deletions

View File

@@ -34,5 +34,14 @@ export const api = {
});
if (!res.ok) throw new Error(await res.text());
return res.json();
},
patch: async (endpoint: string, data: any) => {
const res = await fetch(`${API_URL}${endpoint}`, {
method: 'PATCH',
headers: headers(),
body: JSON.stringify(data)
});
if (!res.ok) throw new Error(await res.text());
return res.json();
}
};