mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Rename comments --> notes
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
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',
|
||||
})
|
||||
export class DocumentCommentsService extends AbstractPaperlessService<PaperlessDocumentComment> {
|
||||
constructor(http: HttpClient) {
|
||||
super(http, 'documents')
|
||||
}
|
||||
|
||||
getComments(documentId: number): Observable<PaperlessDocumentComment[]> {
|
||||
return this.http.get<PaperlessDocumentComment[]>(
|
||||
this.getResourceUrl(documentId, 'comments')
|
||||
)
|
||||
}
|
||||
|
||||
addComment(id: number, comment): Observable<PaperlessDocumentComment[]> {
|
||||
return this.http.post<PaperlessDocumentComment[]>(
|
||||
this.getResourceUrl(id, 'comments'),
|
||||
{ comment: comment }
|
||||
)
|
||||
}
|
||||
|
||||
deleteComment(
|
||||
documentId: number,
|
||||
commentId: number
|
||||
): Observable<PaperlessDocumentComment[]> {
|
||||
return this.http.delete<PaperlessDocumentComment[]>(
|
||||
this.getResourceUrl(documentId, 'comments'),
|
||||
{ params: new HttpParams({ fromString: `id=${commentId}` }) }
|
||||
)
|
||||
}
|
||||
}
|
37
src-ui/src/app/services/rest/document-notes.service.ts
Normal file
37
src-ui/src/app/services/rest/document-notes.service.ts
Normal file
@@ -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}` }) }
|
||||
)
|
||||
}
|
||||
}
|
@@ -22,6 +22,7 @@ export const DOCUMENT_SORT_FIELDS = [
|
||||
{ field: 'created', name: $localize`Created` },
|
||||
{ field: 'added', name: $localize`Added` },
|
||||
{ field: 'modified', name: $localize`Modified` },
|
||||
{ field: 'num_notes', name: $localize`Notes` },
|
||||
]
|
||||
|
||||
export const DOCUMENT_SORT_FIELDS_FULLTEXT = [
|
||||
|
Reference in New Issue
Block a user