]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix comment service method signature
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Sun, 7 Aug 2022 22:06:52 +0000 (15:06 -0700)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Wed, 24 Aug 2022 02:19:21 +0000 (19:19 -0700)
and run prettier over file

src-ui/src/app/services/rest/document-comment.service.ts

index b5739d65e1220db2ea60c3ff221eb2ae299640f7..2dfbb318556b531c695e5b416de559ec5fceab8b 100644 (file)
@@ -1,31 +1,39 @@
-import { Injectable } from '@angular/core';
-import { HttpClient, HttpParams } from '@angular/common/http';
-import { PaperlessDocumentComment } from 'src/app/data/paperless-document-comment';
-import { AbstractPaperlessService } from './abstract-paperless-service';
-import { Observable } from 'rxjs';
-import { PaperlessDocumentCommentFrame } from 'src/app/data/paperless-document-comment-frame';
+import { Injectable } from '@angular/core'
+import { HttpClient, HttpParams } from '@angular/common/http'
+import { PaperlessDocumentComment } from 'src/app/data/paperless-document-comment'
+import { AbstractPaperlessService } from './abstract-paperless-service'
+import { Observable } from 'rxjs'
 
 @Injectable({
-    providedIn: 'root'
+  providedIn: 'root',
 })
 export class DocumentCommentService extends AbstractPaperlessService<PaperlessDocumentComment> {
-
   constructor(http: HttpClient) {
     super(http, 'documents')
   }
 
-
-  getComments(id: number): Observable<PaperlessDocumentComment> {
-    return this.http.get<PaperlessDocumentComment[]>(this.getResourceUrl(id, "comments"))
+  getComments(id: number): Observable<PaperlessDocumentComment[]> {
+    return this.http.get<PaperlessDocumentComment[]>(
+      this.getResourceUrl(id, 'comments')
+    )
   }
 
-  addComment(id: number, comment): Observable<PaperlessDocumentComment[]>{
-    return this.http.post<PaperlessDocumentComment[]>(this.getResourceUrl(id, 'comments'), {"payload": comment})
+  addComment(id: number, comment): Observable<PaperlessDocumentComment[]> {
+    return this.http.post<PaperlessDocumentComment[]>(
+      this.getResourceUrl(id, 'comments'),
+      { payload: comment }
+    )
   }
 
-  deleteComment(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});
+  deleteComment(
+    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 }
+    )
   }
-} 
\ No newline at end of file
+}