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, body: data,
json: false, json: false,
external: true, external: true,
parseResponse: response => response as any,
}) })
return { publicUrl } return { publicUrl }
}, },

View File

@ -163,13 +163,7 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
} else if (parseResponse) { } else if (parseResponse) {
return await parseResponse(response) return await parseResponse(response)
} else { } else {
const text = await response.text() return (await response.json()) as ResponseT
// 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
} }
} catch (error) { } catch (error) {
delete cache[url] delete cache[url]