fix: eslint errors, switch to using maps

This commit is contained in:
Huskydog9988
2025-04-15 20:04:45 -04:00
parent e362f732e7
commit 8f429e1e56
21 changed files with 158 additions and 159 deletions

View File

@@ -31,6 +31,7 @@ export const fetchNews = async (options?: {
const news = useNews();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore forget why this ignor exists
const newValue = await $dropFetch(`/api/v1/news?${query.toString()}`);

View File

@@ -17,6 +17,8 @@ interface DropFetch<
request: R,
opts?: O,
): Promise<
// sometimes there is an error, other times there isn't
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
TypedInternalResponse<
R,
@@ -28,7 +30,7 @@ interface DropFetch<
export const $dropFetch: DropFetch = async (request, opts) => {
if (!getCurrentInstance()?.proxy) {
return (await $fetch(request, opts)) as any;
return await $fetch(request, opts);
}
const id = request.toString();
@@ -45,7 +47,7 @@ export const $dropFetch: DropFetch = async (request, opts) => {
const data = await $fetch(request, {
...opts,
headers: { ...opts?.headers, ...headers },
} as any);
});
if (import.meta.server) state.value = data;
return data as any;
return data;
};