Browse Source

Update comment service to accept comment dto

pull/1233/head
Hironsan 4 years ago
parent
commit
74c3246a9e
1 changed files with 7 additions and 4 deletions
  1. 11
      frontend/services/application/comment.service.ts

11
frontend/services/application/comment.service.ts

@ -38,12 +38,15 @@ export class CommentApplicationService {
return this.repository.create(projectId, docId, text)
}
public update(projectId: string, docId: string, item: CommentItem): Promise<CommentItem> {
return this.repository.update(projectId, docId, item)
public update(projectId: string, docId: string, item: CommentReadDTO): Promise<CommentItem> {
const comment = new CommentItem(
item.id, item.user, item.username, parseInt(docId), item.documentText, item.text, item.createdAt
)
return this.repository.update(projectId, docId, comment)
}
public delete(projectId: string, docId: string, item: CommentItem): Promise<void> {
return this.repository.delete(projectId, docId, item)
public delete(projectId: string, docId: string, item: CommentReadDTO): Promise<void> {
return this.repository.delete(projectId, docId, item.id)
}
public deleteBulk(projectId: string, items: CommentReadDTO[]): Promise<void> {

Loading…
Cancel
Save