Skip to content

Commit c768f53

Browse files
committed
Update fetch.ts
1 parent 4612056 commit c768f53

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/lib/api/fetch.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,6 @@ export const fetchApiServerJson = async <T>(
7777
body?: BodyInit,
7878
): Promise<T> => {
7979
const res = await fetchApiServer(path, config, jq, httpMethod, body);
80-
const data = await parseJsonOrText(res);
8180

82-
return data as T;
83-
};
84-
85-
// request is of [path, config, jq]
86-
export const fetchApiServerJsonMultiple = (requests: [string | null, ApiConfig, string | undefined][]) => {
87-
return Promise.all(
88-
requests
89-
.filter((r) => r[0] !== null)
90-
.map(([path, config, jq]) =>
91-
// @ts-expect-error path is not null
92-
fetchApiServer(path, config, jq).then((res) => parseJsonOrText(res)),
93-
),
94-
);
81+
return await res.json();
9582
};

0 commit comments

Comments
 (0)