Fix fetch request content type (#2562)

This commit is contained in:
Anbraten 2023-10-10 16:26:56 +02:00 committed by GitHub
parent c15ef3ca76
commit f54cc2f853
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
});