Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ui/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ class ApiClient {
private async apiFetch<T>(endpoint: string, options: RequestInit = {}): Promise<T> {
const url = `${this.baseUrl}${endpoint}`;

// Only set Content-Type if there is a body
const contentType = options.body ? 'application/json' : '';

const config: RequestInit = {
...options,
headers: {
...this.createHeaders(),
...this.createHeaders(contentType),
...options.headers,
},
};
Expand Down