Skip to content

Commit

Permalink
♻️ refactor : Optimize API functionality
Browse files Browse the repository at this point in the history
- Changed the process for specifying content types in fetch

Related Issue : YJU-OKURA#128
  • Loading branch information
Lainari committed May 8, 2024
1 parent f40e27c commit a5bba35
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/api/apiUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const req = async (
headers.append('Authorization', `Bearer ${token}`);
}

if (body instanceof FormData) {
headers.append('Content-Type', 'multipart/form-data');
} else if (body) {
if (!(body instanceof FormData) && body) {
headers.append('Content-Type', 'application/json');
body = JSON.stringify(body);
}
Expand Down

0 comments on commit a5bba35

Please sign in to comment.