pediatric-ai-scribe-v3/public/js/learningHub/api.js
2026-05-08 09:32:58 +02:00

15 lines
480 B
JavaScript

export function getJson(url) {
return fetch(url, { headers: getAuthHeaders() }).then(function(r) { return r.json(); });
}
export function sendJson(url, method, payload) {
return fetch(url, {
method: method,
headers: getAuthHeaders(),
body: JSON.stringify(payload || {})
}).then(function(r) { return r.json(); });
}
export function deleteJson(url) {
return fetch(url, { method: 'DELETE', headers: getAuthHeaders() }).then(function(r) { return r.json(); });
}