fix: update request body handling in POST and PUT methods to accept raw data

This commit is contained in:
Mo Tarbin
2026-02-08 21:19:55 -05:00
parent 0beb876cb4
commit 117d8b99df

View File

@@ -234,10 +234,11 @@ class ApiClient {
if (!options.headers['Content-Type']) { if (!options.headers['Content-Type']) {
options.headers['Content-Type'] = 'application/json' options.headers['Content-Type'] = 'application/json'
} }
return this.request(endpoint, { return this.request(endpoint, {
...options, options: { ...options },
method: 'POST', method: 'POST',
body: data ? JSON.stringify(data) : undefined, body: data ? data : undefined,
}) })
} }
@@ -249,7 +250,7 @@ class ApiClient {
return this.request(endpoint, { return this.request(endpoint, {
...options, ...options,
method: 'PUT', method: 'PUT',
body: data ? JSON.stringify(data) : undefined, body: data ? data : undefined,
}) })
} }