feat: fill pages
All checks were successful
Publish Docker Images / build-and-publish (push) Successful in 10m25s

This commit is contained in:
2025-11-11 19:12:21 +01:00
parent 3f828a754b
commit fceeb5307c
38 changed files with 634 additions and 65 deletions

View File

@@ -0,0 +1,37 @@
export function useApi() {
const config = useRuntimeConfig();
const backend = config.public.apiBase;
const commonBaseOptions = { baseURL: backend };
const get = (endpoint, options = {}) =>
useFetch(endpoint, {
method: 'GET',
...commonBaseOptions,
...options,
});
const post = (endpoint, body, options = {}) =>
$fetch(endpoint, {
method: 'POST',
body,
...commonBaseOptions,
...options,
});
const put = (endpoint, body, options = {}) =>
$fetch(endpoint, {
body,
method: 'PUT',
...commonBaseOptions,
...options,
});
const del = (endpoint, options = {}) =>
$fetch(endpoint, {
method: 'DELETE',
...commonBaseOptions,
...options,
});
return { get, post, put, del };
}