mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
qfix: pass file uuid to uppy metadata (#6985)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
bad07b90fc
commit
c0021bbe7c
@ -128,8 +128,11 @@ export function getUppy (options: FileUploadOptions): Uppy<UppyMeta, UppyBody> {
|
||||
uppy.addPreProcessor(async (fileIds: string[]) => {
|
||||
for (const fileId of fileIds) {
|
||||
const file = uppy.getFile(fileId)
|
||||
if (file != null && file.meta.uuid === undefined) {
|
||||
uppy.setFileMeta(fileId, { uuid: generateFileId() })
|
||||
if (file != null) {
|
||||
// It may seem weird that we modify file name here
|
||||
// but we need a way to pass file UUID to Datalake via form data
|
||||
const uuid = file.meta.uuid ?? generateFileId()
|
||||
uppy.setFileMeta(fileId, { uuid, name: uuid })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user