From 8efb2d701c110dc08ea1f460afa2d1c9da481f7f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 10 Dec 2024 14:53:30 +0000 Subject: [PATCH] Fix TS errors --- packages/frontend-core/src/api/attachments.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/api/attachments.ts b/packages/frontend-core/src/api/attachments.ts index 31a8041cc1..0cedfb2cf1 100644 --- a/packages/frontend-core/src/api/attachments.ts +++ b/packages/frontend-core/src/api/attachments.ts @@ -27,7 +27,7 @@ export interface AttachmentEndpoints { bucket: string, key: string, data: any - ) => Promise<{ publicUrl: string }> + ) => Promise<{ publicUrl: string | undefined }> } export const buildAttachmentEndpoints = ( @@ -92,6 +92,9 @@ export const buildAttachmentEndpoints = ( bucket, key ) + if (!signedUrl) { + return { publicUrl: undefined } + } await API.put({ url: signedUrl, body: data, @@ -100,6 +103,7 @@ export const buildAttachmentEndpoints = ( }) return { publicUrl } }, + /** * Download an attachment from a row given its column name. * @param datasourceId the ID of the datasource to download from