wip(frontend) : api calls + skeleton fetch

This commit is contained in:
2026-01-12 13:03:41 +01:00
parent e99f053233
commit b5af7f13b6
6 changed files with 24 additions and 3 deletions

View File

@@ -24,6 +24,10 @@ export function useApi () {
const response = await fetch(url, {
...defaultOptions,
...options,
headers: {
...defaultOptions.headers,
...options.headers
},
signal: controller.signal
})
@@ -70,6 +74,9 @@ export function useApi () {
const post = async (endpoint, data) => {
return apiCall(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/ld+json'
},
body: JSON.stringify(data)
})
}
@@ -77,6 +84,9 @@ export function useApi () {
const patch = async (endpoint, data) => {
return apiCall(endpoint, {
method: 'PATCH',
headers: {
'Content-Type': 'application/merge-patch+json'
},
body: JSON.stringify(data)
})
}