This commit is contained in:
2023-02-27 19:40:03 +10:00
parent 1ee2a1189d
commit 955c06f5aa
30 changed files with 767 additions and 586 deletions

View File

@@ -20,7 +20,7 @@ interface ApiOptions {
export interface ApiResponse {
status: number;
message: string;
data: Record<string, unknown>;
data: unknown;
json?: Record<string, unknown>;
}
@@ -84,10 +84,13 @@ export const api = {
const fetchOptions: RequestInit = {
method: options.method || "GET",
headers: options.headers,
body: options.body,
signal: options.signal || null,
};
if (typeof options.body == "string" && options.body.length > 0) {
fetchOptions.body = options.body;
}
const progressStore = useProgressStore();
progressStore.start();