better toasts

This commit is contained in:
jonaswinkler
2020-12-28 21:52:09 +01:00
parent a881a7ee4f
commit 619e25d71b
5 changed files with 23 additions and 32 deletions

View File

@@ -5,7 +5,7 @@ import { Observable } from 'rxjs';
import { MATCHING_ALGORITHMS } from 'src/app/data/matching-model';
import { ObjectWithId } from 'src/app/data/object-with-id';
import { AbstractPaperlessService } from 'src/app/services/rest/abstract-paperless-service';
import { Toast, ToastService } from 'src/app/services/toast.service';
import { ToastService } from 'src/app/services/toast.service';
@Directive()
export abstract class EditDialogComponent<T extends ObjectWithId> implements OnInit {
@@ -66,7 +66,7 @@ export abstract class EditDialogComponent<T extends ObjectWithId> implements OnI
this.activeModal.close()
this.success.emit(result)
}, error => {
this.toastService.showToast(Toast.makeError(`Could not save ${this.entityName}: ${error.error.name}`))
this.toastService.showError($localize`Could not save ${this.entityName}: ${error.error.name}`)
})
}