fix: implement feedback

This commit is contained in:
Mythie
2023-09-14 13:21:03 +10:00
parent 5a99a0b5eb
commit 0835da45ef
9 changed files with 48 additions and 34 deletions

View File

@ -42,11 +42,15 @@ const updateFileWithBytes64 = (data: string) => {
const updateFileWithS3 = async (key: string, data: string) => {
const { url } = await getAbsolutePresignPostUrl(key);
await fetch(url, {
const response = await fetch(url, {
method: 'PUT',
body: data,
});
if (!response.ok) {
throw new Error(`Failed to update file "${key}", failed with status code ${response.status}`);
}
return {
type: DocumentDataType.S3_PATH,
data: key,