This commit is contained in:
Benjamin Toby
2024-11-08 18:28:55 +01:00
parent 7bf1e3a0f9
commit df967a4ffb
4 changed files with 44 additions and 22 deletions
+5 -2
View File
@@ -1100,10 +1100,10 @@ export type CheckApiCredentialsFnParam = {
export type FetchApiFn = (
url: string,
options?: FetchApiOptions,
csrf?: boolean
contentType?: "json" | "text" | "html" | "blob" | "file"
) => Promise<any>;
type FetchApiOptions = {
export type FetchApiOptions = RequestInit & {
method:
| "POST"
| "GET"
@@ -1117,12 +1117,15 @@ type FetchApiOptions = {
| "patch";
body?: object | string;
headers?: FetchHeader;
query?: { [key: string]: any };
};
export type AuthCsrfHeaderName = "x-csrf-auth";
type FetchHeader = HeadersInit & {
[key in AuthCsrfHeaderName]?: string | null;
} & {
[key: string]: any;
};
export type FetchApiReturn = {