From 21ac8304ac97c299c678df9ef6eedabc82beebb8 Mon Sep 17 00:00:00 2001 From: Yanick Minder Date: Fri, 24 Nov 2023 17:04:14 +0100 Subject: [PATCH] display 226 properly --- .../shared/interceptors/error-interceptor.service.ts | 11 ++++++----- frontend/src/assets/i18n/de.json | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/shared/interceptors/error-interceptor.service.ts b/frontend/src/app/shared/interceptors/error-interceptor.service.ts index 35973fe540..1aa9f9ab0a 100644 --- a/frontend/src/app/shared/interceptors/error-interceptor.service.ts +++ b/frontend/src/app/shared/interceptors/error-interceptor.service.ts @@ -40,11 +40,6 @@ export class ErrorInterceptor implements HttpInterceptor { this.translate.instant('ERRORS.' + error.errorKey).format(error.params), ); - if (response.status == 226) { - errors.forEach((error: string) => this.toasterService.showWarn(error)); - return; - } - errors.forEach((error: string) => this.toasterService.showError(error)); } @@ -59,6 +54,12 @@ export class ErrorInterceptor implements HttpInterceptor { if (NO_TOASTER.some((route) => response.url.includes(route))) { return; } + + if (response.status == 226) { + this.toasterService.showWarn(this.translate.instant('ERRORS.ILLEGAL_CHANGE_OBJECTIVE_QUARTER')); + return; + } + switch (method) { case 'POST': { this.toasterService.showSuccess('Element wurde erfolgreich erstellt'); diff --git a/frontend/src/assets/i18n/de.json b/frontend/src/assets/i18n/de.json index 6429ed44da..a9fef76509 100644 --- a/frontend/src/assets/i18n/de.json +++ b/frontend/src/assets/i18n/de.json @@ -45,6 +45,7 @@ "NOT_AUTHORIZED_TO_READ": "Du bist nicht autorisiert um dieses {0} anzuzeigen", "NOT_AUTHORIZED_TO_WRITE":"Du bist nicht autorisiert um dieses {0} zu bearbeiten", "NOT_AUTHORIZED_TO_DELETE": "Du bist nicht autorisiert um dieses {0} zu löschen", - "TOKEN_NULL": "Das erhaltene Token ist null" + "TOKEN_NULL": "Das erhaltene Token ist null", + "ILLEGAL_CHANGE_OBJECTIVE_QUARTER":"Element kann nicht in ein anderes Quartal verlegt werden" } }