mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-12 21:35:40 -05:00
Fix: saved views do not return to default display fields after setting and then removing (#9168)
This commit is contained in:
@@ -87,12 +87,21 @@ export class SavedViewService extends AbstractPaperlessService<SavedView> {
|
||||
return super.create(o).pipe(tap(() => this.reload()))
|
||||
}
|
||||
|
||||
update(o: SavedView) {
|
||||
return super.update(o).pipe(tap(() => this.reload()))
|
||||
patch(o: SavedView, reload: boolean = false): Observable<SavedView> {
|
||||
if (o.display_fields?.length === 0) {
|
||||
o.display_fields = null
|
||||
}
|
||||
return super.patch(o).pipe(
|
||||
tap(() => {
|
||||
if (reload) {
|
||||
this.reload()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
patchMany(objects: SavedView[]): Observable<SavedView[]> {
|
||||
return combineLatest(objects.map((o) => super.patch(o))).pipe(
|
||||
return combineLatest(objects.map((o) => this.patch(o, false))).pipe(
|
||||
tap(() => this.reload())
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user