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 }; }