|
|
|
@ -15,12 +15,7 @@ import { utf8ify } from '~/helpers/stringHelpers';
|
|
|
|
|
export class AttachmentsService { |
|
|
|
|
constructor(private readonly appHooksService: AppHooksService) {} |
|
|
|
|
|
|
|
|
|
async upload(param: { |
|
|
|
|
path?: string; |
|
|
|
|
// todo: proper type
|
|
|
|
|
files: unknown[]; |
|
|
|
|
req: any; |
|
|
|
|
}) { |
|
|
|
|
async upload(param: { path?: string; files: FileType[]; req: any }) { |
|
|
|
|
// TODO: add getAjvValidatorMw
|
|
|
|
|
const filePath = this.sanitizeUrlPath( |
|
|
|
|
param.path?.toString()?.split('/') || [''], |
|
|
|
@ -88,7 +83,6 @@ export class AttachmentsService {
|
|
|
|
|
|
|
|
|
|
this.appHooksService.emit(AppEvents.ATTACHMENT_UPLOAD, { |
|
|
|
|
type: 'file', |
|
|
|
|
req: param.req, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return attachments; |
|
|
|
@ -96,12 +90,7 @@ export class AttachmentsService {
|
|
|
|
|
|
|
|
|
|
async uploadViaURL(param: { |
|
|
|
|
path?: string; |
|
|
|
|
urls: { |
|
|
|
|
url: string; |
|
|
|
|
fileName: string; |
|
|
|
|
mimetype?: string; |
|
|
|
|
size?: string | number; |
|
|
|
|
}[]; |
|
|
|
|
urls: AttachmentReqType[]; |
|
|
|
|
req: any; |
|
|
|
|
}) { |
|
|
|
|
// TODO: add getAjvValidatorMw
|
|
|
|
|