next/composables/useApiFetch.ts

11 lines
275 B
TypeScript
Raw Normal View History

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