mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Fix mail account / rule delete
This commit is contained in:
parent
52d3a8703c
commit
ea1ea0816f
@ -543,7 +543,22 @@ export class SettingsComponent
|
|||||||
modal.componentInstance.btnCaption = $localize`Proceed`
|
modal.componentInstance.btnCaption = $localize`Proceed`
|
||||||
modal.componentInstance.confirmClicked.subscribe(() => {
|
modal.componentInstance.confirmClicked.subscribe(() => {
|
||||||
modal.componentInstance.buttonsEnabled = false
|
modal.componentInstance.buttonsEnabled = false
|
||||||
this.mailAccountService.delete(account)
|
this.mailAccountService.delete(account).subscribe({
|
||||||
|
next: () => {
|
||||||
|
modal.close()
|
||||||
|
this.toastService.showInfo($localize`Deleted mail account`)
|
||||||
|
this.mailAccountService.clearCache()
|
||||||
|
this.mailAccountService.listAll().subscribe((r) => {
|
||||||
|
this.mailAccounts = r.results
|
||||||
|
this.initialize()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
error: (e) => {
|
||||||
|
this.toastService.showError(
|
||||||
|
$localize`Error deleting mail account: ${e.toString()}.`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,7 +601,22 @@ export class SettingsComponent
|
|||||||
modal.componentInstance.btnCaption = $localize`Proceed`
|
modal.componentInstance.btnCaption = $localize`Proceed`
|
||||||
modal.componentInstance.confirmClicked.subscribe(() => {
|
modal.componentInstance.confirmClicked.subscribe(() => {
|
||||||
modal.componentInstance.buttonsEnabled = false
|
modal.componentInstance.buttonsEnabled = false
|
||||||
this.mailRuleService.delete(rule)
|
this.mailRuleService.delete(rule).subscribe({
|
||||||
|
next: () => {
|
||||||
|
modal.close()
|
||||||
|
this.toastService.showInfo($localize`Deleted mail rule`)
|
||||||
|
this.mailRuleService.clearCache()
|
||||||
|
this.mailRuleService.listAll().subscribe((r) => {
|
||||||
|
this.mailRules = r.results
|
||||||
|
this.initialize()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
error: (e) => {
|
||||||
|
this.toastService.showError(
|
||||||
|
$localize`Error deleting mail rule: ${e.toString()}.`
|
||||||
|
)
|
||||||
|
},
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user