diff --git a/apps/red-ui/src/app/services/entity-services/dossier-states.service.ts b/apps/red-ui/src/app/services/entity-services/dossier-states.service.ts index a10efcb51..be184356c 100644 --- a/apps/red-ui/src/app/services/entity-services/dossier-states.service.ts +++ b/apps/red-ui/src/app/services/entity-services/dossier-states.service.ts @@ -10,21 +10,24 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { mapEach } from '@iqser/common-ui/lib/utils'; const CONFLICT_MSG = _('dossier-states-listing.error.conflict'); -const GENERIC_MSG = _('dossier-states-listing.error.generic'); @Injectable({ providedIn: 'root', }) export class DossierStatesService extends EntitiesService { + protected readonly _defaultModelPath = 'dossier-status'; + protected readonly _entityClass = DossierState; readonly #toaster = inject(Toaster); readonly #dossierTemplatesService = inject(DossierTemplatesService); readonly #dossierStatesMapService = inject(DossierStatesMapService); - protected readonly _defaultModelPath = 'dossier-status'; - protected readonly _entityClass = DossierState; async createOrUpdate(state: IDossierState) { const showToast = (error: HttpErrorResponse) => { - this.#toaster.error(error.status === HttpStatusCode.Conflict ? CONFLICT_MSG : GENERIC_MSG); + if (error.status === HttpStatusCode.Conflict) { + this.#toaster.error(CONFLICT_MSG); + } else { + this.#toaster.rawError(error.error.message); + } return EMPTY; }; diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 8161f7c92..06e3890ee 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -1065,8 +1065,7 @@ "dossier-states": "{count, plural, one{Dossier-Status} other{Dossier-Status}}" }, "error": { - "conflict": "Es gibt bereits einen Dossier-Status mit diesem Namen.", - "generic": "Speichern des Dossier-Status fehlgeschlagen." + "conflict": "Es gibt bereits einen Dossier-Status mit diesem Namen." }, "no-data": { "title": "Es wurde noch kein Dossier-Status angelegt." diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index ce30992f1..6a0f3511a 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -1065,8 +1065,7 @@ "dossier-states": "{count, plural, one{Dossier state} other{Dossier states}}" }, "error": { - "conflict": "Dossier state with this name already exists", - "generic": "Failed to save dossier state." + "conflict": "Dossier state with this name already exists" }, "no-data": { "title": "There are no dossier states." diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index f10837a8b..6f36ad508 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -1065,8 +1065,7 @@ "dossier-states": "{count, plural, one{Dossier state} other{Dossier states}}" }, "error": { - "conflict": "Dossier state with this name already exists!", - "generic": "Failed to save dossier state!" + "conflict": "Dossier state with this name already exists!" }, "no-data": { "title": "There are no dossier states." diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 21a21c256..807cc35c3 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -1065,8 +1065,7 @@ "dossier-states": "{count, plural, one{Dossier state} other{Dossier states}}" }, "error": { - "conflict": "Dossier state with this name already exists!", - "generic": "Failed to save dossier state!" + "conflict": "Dossier state with this name already exists!" }, "no-data": { "title": "There are no dossier states."