feat: refactor news and migrate rest of useFetch to $dropFetch

This commit is contained in:
DecDuck
2025-03-14 13:12:04 +11:00
parent bd1cb67cd0
commit 1de9ebdfa5
23 changed files with 299 additions and 297 deletions
+5 -1
View File
@@ -31,7 +31,11 @@ export const $dropFetch: DropFetch = async (request, opts) => {
if (!getCurrentInstance()?.proxy) {
return (await $fetch(request, opts)) as any;
}
const { data, error } = await useFetch(request, opts as any);
const headers = useRequestHeaders(["cookie"]);
const { data, error } = await useFetch(request, {
...opts,
headers: { ...opts?.headers, ...headers },
} as any);
if (error.value) throw error.value;
return data.value as any;
};