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,
|
body: data,
|
||||||
json: false,
|
json: false,
|
||||||
external: true,
|
external: true,
|
||||||
|
parseResponse: response => response as any,
|
||||||
})
|
})
|
||||||
return { publicUrl }
|
return { publicUrl }
|
||||||
},
|
},
|
||||||
|
|
|
@ -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]
|
||||||
|
|
Loading…
Reference in New Issue