mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-11 10:37:12 +00:00
Rename comments --> notes
This commit is contained in:
1 parent
89c639f850
commit
bf8ae22f3f
45 files changed
+540
-528
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HttpClient, HttpParams } from '@angular/common/http'
|
||||
import { PaperlessDocumentNote } from 'src/app/data/paperless-document-note'
|
||||
import { AbstractPaperlessService } from './abstract-paperless-service'
|
||||
import { Observable } from 'rxjs'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class DocumentNotesService extends AbstractPaperlessService<PaperlessDocumentNote> {
|
||||
constructor(http: HttpClient) {
|
||||
super(http, 'documents')
|
||||
}
|
||||
|
||||
getNotes(documentId: number): Observable<PaperlessDocumentNote[]> {
|
||||
return this.http.get<PaperlessDocumentNote[]>(
|
||||
this.getResourceUrl(documentId, 'notes')
|
||||
)
|
||||
}
|
||||
|
||||
addNote(id: number, note: string): Observable<PaperlessDocumentNote[]> {
|
||||
return this.http.post<PaperlessDocumentNote[]>(
|
||||
this.getResourceUrl(id, 'notes'),
|
||||
{ note: note }
|
||||
)
|
||||
}
|
||||
|
||||
deleteNote(
|
||||
documentId: number,
|
||||
noteId: number
|
||||
): Observable<PaperlessDocumentNote[]> {
|
||||
return this.http.delete<PaperlessDocumentNote[]>(
|
||||
this.getResourceUrl(documentId, 'notes'),
|
||||
{ params: new HttpParams({ fromString: `id=${noteId}` }) }
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user