|
|
@ -12,6 +12,7 @@ import Local from '~/plugins/storage/Local'; |
|
|
|
import mimetypes, { mimeIcons } from '~/utils/mimeTypes'; |
|
|
|
import mimetypes, { mimeIcons } from '~/utils/mimeTypes'; |
|
|
|
import { PresignedUrl } from '~/models'; |
|
|
|
import { PresignedUrl } from '~/models'; |
|
|
|
import { utf8ify } from '~/helpers/stringHelpers'; |
|
|
|
import { utf8ify } from '~/helpers/stringHelpers'; |
|
|
|
|
|
|
|
import { NcError } from '~/helpers/catchError'; |
|
|
|
|
|
|
|
|
|
|
|
@Injectable() |
|
|
|
@Injectable() |
|
|
|
export class AttachmentsService { |
|
|
|
export class AttachmentsService { |
|
|
@ -34,6 +35,10 @@ export class AttachmentsService { |
|
|
|
const attachments = []; |
|
|
|
const attachments = []; |
|
|
|
const errors = []; |
|
|
|
const errors = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!param.files?.length) { |
|
|
|
|
|
|
|
NcError.badRequest('No attachment provided!'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
queue.addAll( |
|
|
|
queue.addAll( |
|
|
|
param.files?.map((file) => async () => { |
|
|
|
param.files?.map((file) => async () => { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -127,6 +132,10 @@ export class AttachmentsService { |
|
|
|
const attachments = []; |
|
|
|
const attachments = []; |
|
|
|
const errors = []; |
|
|
|
const errors = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!param.urls?.length) { |
|
|
|
|
|
|
|
NcError.badRequest('No attachment provided!'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
queue.addAll( |
|
|
|
queue.addAll( |
|
|
|
param.urls?.map?.((urlMeta) => async () => { |
|
|
|
param.urls?.map?.((urlMeta) => async () => { |
|
|
|
try { |
|
|
|
try { |
|
|
|