From f54cc2f853845a31e237feffa3eab47e5542f64a Mon Sep 17 00:00:00 2001 From: Anbraten Date: Tue, 10 Oct 2023 16:26:56 +0200 Subject: [PATCH] Fix fetch request content type (#2562) --- web/src/lib/api/client.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/lib/api/client.ts b/web/src/lib/api/client.ts index b362d0efa..aab22ee55 100644 --- a/web/src/lib/api/client.ts +++ b/web/src/lib/api/client.ts @@ -45,6 +45,7 @@ export default class ApiClient { headers: { ...(method !== 'GET' && this.csrf ? { 'X-CSRF-TOKEN': this.csrf } : {}), ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}), + ...(data ? { 'Content-Type': 'application/json' } : {}), }, body: data ? JSON.stringify(data) : undefined, });