Skip to content

Commit

Permalink
chore: revert fetch wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
althafdaa committed Aug 4, 2024
1 parent 133f1da commit 1c98f83
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/fetch-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ export const fetchInstance = async <T>(

const headers: HeadersInit & {
'Content-Type'?: string;
} = {};
} = {
'Content-Type': 'application/json',
};

const accessToken = nookies.get(c).access_token;
if (accessToken) {
Expand All @@ -78,8 +80,8 @@ export const fetchInstance = async <T>(
}

const isFormData = body instanceof FormData;
if (!isFormData) {
headers['Content-Type'] = 'application/json';
if (isFormData) {
delete headers['Content-Type'];
}

const config: RequestInit = {
Expand Down

0 comments on commit 1c98f83

Please sign in to comment.