|
|
|
@ -120,6 +120,8 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
|
|
|
|
|
|
|
|
|
|
const attachmentMeta = typeof column.value?.meta === 'string' ? JSON.parse(column.value.meta) : column.value?.meta |
|
|
|
|
|
|
|
|
|
const files: File[] = [] |
|
|
|
|
|
|
|
|
|
for (let file of selectedFiles) { |
|
|
|
|
// verify number of files
|
|
|
|
|
if (selectedFiles.length > attachmentMeta.maxNumberOfAttachments) { |
|
|
|
@ -145,13 +147,16 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
|
|
|
|
|
|
|
|
|
|
file = await renameFile(file) |
|
|
|
|
|
|
|
|
|
files.push(file) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
const data = await api.storage.upload( |
|
|
|
|
{ |
|
|
|
|
path: [NOCO, project.value.title, meta.value?.title, column.value?.title].join('/'), |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
files: file, |
|
|
|
|
files, |
|
|
|
|
json: '{}', |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
@ -159,7 +164,6 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
|
|
|
|
|
} catch (e: any) { |
|
|
|
|
message.error(e.message || t('msg.error.internalError')) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
updateModelValue(JSON.stringify([...attachments.value, ...newAttachments])) |
|
|
|
|
} |
|
|
|
|