mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-16 11:36:39 +01:00
editable saved views
This commit is contained in:
parent
67d03c11b9
commit
ff71b04848
5 changed files with 84 additions and 27 deletions
|
|
@ -92,4 +92,10 @@ export abstract class AbstractPaperlessService<T extends ObjectWithId> {
|
|||
this._listAll = null
|
||||
return this.http.put<T>(this.getResourceUrl(o.id), o)
|
||||
}
|
||||
}
|
||||
|
||||
patch(o: T): Observable<T> {
|
||||
this._listAll = null
|
||||
return this.http.patch<T>(this.getResourceUrl(o.id), o)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { combineLatest, Observable } from 'rxjs';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { PaperlessSavedView } from 'src/app/data/paperless-saved-view';
|
||||
import { AbstractPaperlessService } from './abstract-paperless-service';
|
||||
|
|
@ -44,6 +45,12 @@ export class SavedViewService extends AbstractPaperlessService<PaperlessSavedVie
|
|||
)
|
||||
}
|
||||
|
||||
patchMany(objects: PaperlessSavedView[]): Observable<PaperlessSavedView[]> {
|
||||
return combineLatest(objects.map(o => super.patch(o))).pipe(
|
||||
tap(() => this.reload())
|
||||
)
|
||||
}
|
||||
|
||||
delete(o: PaperlessSavedView) {
|
||||
return super.delete(o).pipe(
|
||||
tap(() => this.reload())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue