From 4b12d7e12492fb8daa17be33638137ce54bbc60f Mon Sep 17 00:00:00 2001 From: Hironsan Date: Mon, 8 Mar 2021 11:46:54 +0900 Subject: [PATCH] Add upload method --- frontend/services/application/document.service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/services/application/document.service.ts b/frontend/services/application/document.service.ts index 4f287377..d7e3d0d3 100644 --- a/frontend/services/application/document.service.ts +++ b/frontend/services/application/document.service.ts @@ -82,6 +82,15 @@ export class DocumentApplicationService { link.click() } + public async upload(projectId: string, file: File, format: string): Promise { + console.log(file) + console.log(format) + const formData = new FormData() + formData.append('file', file) + formData.append('format', format) + const response = await this.repository.uploadFile(projectId, formData) + } + private toModel(item: DocumentDTO): DocumentItem { return new DocumentItem( item.id,