Browse Source

Add upload method

pull/1242/head
Hironsan 3 years ago
parent
commit
4b12d7e124
1 changed files with 9 additions and 0 deletions
  1. 9
      frontend/services/application/document.service.ts

9
frontend/services/application/document.service.ts

@ -82,6 +82,15 @@ export class DocumentApplicationService {
link.click() link.click()
} }
public async upload(projectId: string, file: File, format: string): Promise<void> {
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 { private toModel(item: DocumentDTO): DocumentItem {
return new DocumentItem( return new DocumentItem(
item.id, item.id,

Loading…
Cancel
Save