From e3f6c3c5c883daf49f61c3a4330d0cb1fc106bd3 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 12 Mar 2021 10:27:12 +0900 Subject: [PATCH] Add document approve method --- frontend/repositories/document/api.ts | 5 +++++ frontend/repositories/document/interface.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/frontend/repositories/document/api.ts b/frontend/repositories/document/api.ts index 81d3c8b8..3b9feec1 100644 --- a/frontend/repositories/document/api.ts +++ b/frontend/repositories/document/api.ts @@ -69,4 +69,9 @@ export class FromApiDocumentItemListRepository implements DocumentItemRepository const url = `/projects/${projectId}/docs/download` return await this.request.get(url, config) } + + async approve(projectId: string, docId: number, approved: boolean): Promise { + const url = `/projects/${projectId}/docs/${docId}/approve-labels` + await this.request.post(url, { approved }) + } } diff --git a/frontend/repositories/document/interface.ts b/frontend/repositories/document/interface.ts index 690b852d..d7592590 100644 --- a/frontend/repositories/document/interface.ts +++ b/frontend/repositories/document/interface.ts @@ -16,4 +16,6 @@ export interface DocumentItemRepository { uploadFile(projectId: string, payload: FormData): Promise exportFile(projectId: string, format: string, onlyApproved: boolean): Promise + + approve(projectId: string, docId: number, approved: boolean): Promise }