feat: disable revalidation for some fetches

This commit is contained in:
swve 2023-05-22 18:44:05 +00:00
parent 2c0e4dc902
commit 0c5b66e0dc
5 changed files with 13 additions and 12 deletions

View file

@ -19,7 +19,7 @@ export const RequestBody = (method: string, data: any, next: any) => {
};
export const RequestBodyWithAuthHeader = (method: string, data: any, next: any, token: string) => {
let HeadersConfig = new Headers({ Authorization: `Bearer ${token}` });
let HeadersConfig = new Headers(token ? { "Content-Type": "application/json", Authorization: `Bearer ${token}` } : { "Content-Type": "application/json" });
let options: any = {
method: method,
headers: HeadersConfig,