Fix TS errors
This commit is contained in:
parent
6463b1c551
commit
8efb2d701c
|
@ -27,7 +27,7 @@ export interface AttachmentEndpoints {
|
||||||
bucket: string,
|
bucket: string,
|
||||||
key: string,
|
key: string,
|
||||||
data: any
|
data: any
|
||||||
) => Promise<{ publicUrl: string }>
|
) => Promise<{ publicUrl: string | undefined }>
|
||||||
}
|
}
|
||||||
|
|
||||||
export const buildAttachmentEndpoints = (
|
export const buildAttachmentEndpoints = (
|
||||||
|
@ -92,6 +92,9 @@ export const buildAttachmentEndpoints = (
|
||||||
bucket,
|
bucket,
|
||||||
key
|
key
|
||||||
)
|
)
|
||||||
|
if (!signedUrl) {
|
||||||
|
return { publicUrl: undefined }
|
||||||
|
}
|
||||||
await API.put({
|
await API.put({
|
||||||
url: signedUrl,
|
url: signedUrl,
|
||||||
body: data,
|
body: data,
|
||||||
|
@ -100,6 +103,7 @@ export const buildAttachmentEndpoints = (
|
||||||
})
|
})
|
||||||
return { publicUrl }
|
return { publicUrl }
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download an attachment from a row given its column name.
|
* Download an attachment from a row given its column name.
|
||||||
* @param datasourceId the ID of the datasource to download from
|
* @param datasourceId the ID of the datasource to download from
|
||||||
|
|
Loading…
Reference in New Issue