From fc79b531c31d7c2f5b4da1c1cc9ce036e5e0e421 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Thu, 4 Mar 2021 10:30:47 +0900 Subject: [PATCH] Update comment repository --- frontend/repositories/comment/api.ts | 8 ++++---- frontend/repositories/comment/interface.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/repositories/comment/api.ts b/frontend/repositories/comment/api.ts index fa72c314..7407d0ec 100644 --- a/frontend/repositories/comment/api.ts +++ b/frontend/repositories/comment/api.ts @@ -7,11 +7,11 @@ export class FromApiCommentItemListRepository implements CommentItemListReposito private readonly request = ApiService ) {} - async listAll(projectId: string, q: string): Promise { + async listAll(projectId: string, q: string): Promise { const url = `/projects/${projectId}/comments?q=${q}` const response = await this.request.get(url) const items: CommentItemResponse[] = response.data - return CommentItemList.valueOf(items.map(item => CommentItem.valueOf(item))) + return items.map(item => CommentItem.valueOf(item)) } async list(projectId: string, docId: string): Promise { @@ -40,8 +40,8 @@ export class FromApiCommentItemListRepository implements CommentItemListReposito const response = await this.request.delete(url) } - async deleteBulk(projectId: string, items: CommentItemList): Promise { + async deleteBulk(projectId: string, items: number[]): Promise { const url = `/projects/${projectId}/comments` - await this.request.delete(url, { ids: items.ids() }) + await this.request.delete(url, { ids: items }) } } diff --git a/frontend/repositories/comment/interface.ts b/frontend/repositories/comment/interface.ts index f3991440..ea8da645 100644 --- a/frontend/repositories/comment/interface.ts +++ b/frontend/repositories/comment/interface.ts @@ -11,7 +11,7 @@ export interface CommentItemResponse { } export interface CommentItemListRepository { - listAll(projectId: string, q: string): Promise + listAll(projectId: string, q: string): Promise list(projectId: string, docId: string): Promise @@ -21,5 +21,5 @@ export interface CommentItemListRepository { delete(projectId: string, docId: string, item: CommentItem): Promise - deleteBulk(projectId: string, items: CommentItemList): Promise + deleteBulk(projectId: string, items: number[]): Promise }