diff --git a/client/src/adapters/util.ts b/client/src/adapters/util.ts index dcaa7e1650ef645717ef6b5ed0dd98f79baf8d5f..dfa74027547af905c3c11beef372084c33b136ca 100644 --- a/client/src/adapters/util.ts +++ b/client/src/adapters/util.ts @@ -22,13 +22,15 @@ async function executeApiRequest<T>(path: string, method: string, body: any, onS method: method, headers: { ...getAuthHeader(), - ...(body ? ( - body instanceof FormData - ? { 'Content-Type': 'multipart/form-data' } - : { 'Content-Type': 'application/json' }) + ...(body && !(body instanceof FormData) + ? { 'Content-Type': 'application/json' } : { }), }, - body: body ? JSON.stringify(body) : undefined, + body: body + ? (body instanceof FormData + ? body + : JSON.stringify(body)) + : undefined, }); if (response.ok) { return onSuccess(await response.json());