PR feedback. Limit API changes only to the S3 PR
This commit is contained in:
parent
7f639a45a7
commit
411924b497
|
@ -100,6 +100,7 @@ export const buildAttachmentEndpoints = (
|
|||
body: data,
|
||||
json: false,
|
||||
external: true,
|
||||
parseResponse: response => response as any,
|
||||
})
|
||||
return { publicUrl }
|
||||
},
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue