feat(composables): add fetch helper function

extend useFetch with a helper that prepends `/api` to the url, as well as makes the default http method "GET"
This commit is contained in:
parent 1db9bdec9c
commit 3640c0db11
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -0,0 +1,11 @@
import { UseFetchOptions } from "nuxt/app";
const useApiFetch = async (url: string, options?: any) => {
const at = useCookie("rockfic_cookie", {default: undefined})
return useFetch("/api" + url, {
method: "get",
...options,
})
}
export default useApiFetch