Updates
This commit is contained in:
Vendored
+3
-10
@@ -1,3 +1,4 @@
|
||||
import { DSQLClientFetchHeader } from "../../package-shared/types";
|
||||
type FetchApiOptions<T extends {
|
||||
[k: string]: any;
|
||||
} = {
|
||||
@@ -5,10 +6,7 @@ type FetchApiOptions<T extends {
|
||||
}> = {
|
||||
method: "POST" | "GET" | "DELETE" | "PUT" | "PATCH" | "post" | "get" | "delete" | "put" | "patch";
|
||||
body?: T | string;
|
||||
headers?: FetchHeader;
|
||||
};
|
||||
type FetchHeader = HeadersInit & {
|
||||
[key: string]: string | null;
|
||||
headers?: DSQLClientFetchHeader;
|
||||
};
|
||||
export type FetchApiReturn = {
|
||||
success: boolean;
|
||||
@@ -27,10 +25,5 @@ export default function fetchApi<T extends {
|
||||
/**
|
||||
* Key to use to grab local Storage csrf value.
|
||||
*/
|
||||
localStorageCSRFKey?: string,
|
||||
/**
|
||||
* Key with which to set the request header csrf
|
||||
* value
|
||||
*/
|
||||
csrfHeaderKey?: string): Promise<R>;
|
||||
localStorageCSRFKey?: string): Promise<R>;
|
||||
export {};
|
||||
|
||||
Vendored
+1
-6
@@ -21,12 +21,7 @@ function fetchApi(url, options, csrf,
|
||||
/**
|
||||
* Key to use to grab local Storage csrf value.
|
||||
*/
|
||||
localStorageCSRFKey,
|
||||
/**
|
||||
* Key with which to set the request header csrf
|
||||
* value
|
||||
*/
|
||||
csrfHeaderKey) {
|
||||
localStorageCSRFKey) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let data;
|
||||
const csrfKey = "x-dsql-csrf-key";
|
||||
|
||||
Reference in New Issue
Block a user