mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
remove unused toastService from edit dialogs and add confirmation
This commit is contained in:
@@ -120,8 +120,20 @@ export abstract class ManagementListComponent<T extends ObjectWithId>
|
||||
backdrop: 'static',
|
||||
})
|
||||
activeModal.componentInstance.dialogMode = 'create'
|
||||
activeModal.componentInstance.success.subscribe((o) => {
|
||||
this.reloadData()
|
||||
activeModal.componentInstance.success.subscribe({
|
||||
next: () => {
|
||||
this.reloadData()
|
||||
this.toastService.showInfo(
|
||||
$localize`Successfully created ${this.typeName}.`
|
||||
)
|
||||
},
|
||||
error: (e) => {
|
||||
this.toastService.showInfo(
|
||||
$localize`Error occurred while creating ${
|
||||
this.typeName
|
||||
} : ${e.toString()}.`
|
||||
)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -131,8 +143,20 @@ export abstract class ManagementListComponent<T extends ObjectWithId>
|
||||
})
|
||||
activeModal.componentInstance.object = object
|
||||
activeModal.componentInstance.dialogMode = 'edit'
|
||||
activeModal.componentInstance.success.subscribe((o) => {
|
||||
this.reloadData()
|
||||
activeModal.componentInstance.success.subscribe({
|
||||
next: () => {
|
||||
this.reloadData()
|
||||
this.toastService.showInfo(
|
||||
$localize`Successfully updated ${this.typeName}.`
|
||||
)
|
||||
},
|
||||
error: (e) => {
|
||||
this.toastService.showInfo(
|
||||
$localize`Error occurred while saving ${
|
||||
this.typeName
|
||||
} : ${e.toString()}.`
|
||||
)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user