Skip to content

Commit

Permalink
feat: add form data option for fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-stumpf committed Dec 3, 2024
1 parent 4cbbfde commit a832ed5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/fetchGuildApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export const fetchGuildApi = async <Data = object, Error = ErrorLike>(
if (token) {
headers.set("X-Auth-Token", token);
}
if (requestInit?.body) {
if (requestInit?.body instanceof FormData) {
headers.set("Content-Type", "multipart/form-data");
} else if (requestInit?.body) {
headers.set("Content-Type", "application/json");
}

Expand Down

0 comments on commit a832ed5

Please sign in to comment.