PR feedback. Limit API changes only to the S3 PR

This commit is contained in:
Dean 2025-01-13 12:42:31 +00:00
parent 7f639a45a7
commit 411924b497
2 changed files with 2 additions and 7 deletions

View File

@ -100,6 +100,7 @@ export const buildAttachmentEndpoints = (
body: data,
json: false,
external: true,
parseResponse: response => response as any,
})
return { publicUrl }
},

View File

@ -163,13 +163,7 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
} else if (parseResponse) {
return await parseResponse(response)
} else {
const text = await response.text()
// If the response has no body at all e.g s3.put
if (!text) {
// Empty response
return {} as ResponseT
}
return JSON.parse(text) as ResponseT
return (await response.json()) as ResponseT
}
} catch (error) {
delete cache[url]