Cleanup frontend comment service & other code

[ci skip]
This commit is contained in:
Michael Shamoon
2022-08-07 22:05:32 -07:00
parent 1b56ffd0c0
commit 1d2282df9e
9 changed files with 20 additions and 24 deletions

View File

@@ -21,7 +21,7 @@ export class DocumentCommentsService extends AbstractPaperlessService<PaperlessD
addComment(id: number, comment): Observable<PaperlessDocumentComment[]> {
return this.http.post<PaperlessDocumentComment[]>(
this.getResourceUrl(id, 'comments'),
{ payload: comment }
{ comment: comment }
)
}
@@ -29,11 +29,9 @@ export class DocumentCommentsService extends AbstractPaperlessService<PaperlessD
documentId: number,
commentId: number
): Observable<PaperlessDocumentComment[]> {
let httpParams = new HttpParams()
httpParams = httpParams.set('commentId', commentId.toString())
return this.http.delete<PaperlessDocumentComment[]>(
this.getResourceUrl(documentId, 'comments'),
{ params: httpParams }
{ params: new HttpParams({ fromString: `id=${commentId}` }) }
)
}
}