From d8b915e9470ddd1ef70273c9b64b1850d741e452 Mon Sep 17 00:00:00 2001 From: dsbegnoche Date: Thu, 27 Sep 2018 17:30:50 -0500 Subject: [PATCH] No error message for Schedule Error When saving invalid schedule, error is returned from API, but not displayed. Simple way to recreate is schedule item and enter invalid year (I.E. 0000). I think this may be proper fix, other solution is to remove the catcherror and extra pipe. --- src/Squidex/app/shared/state/contents.state.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Squidex/app/shared/state/contents.state.ts b/src/Squidex/app/shared/state/contents.state.ts index 98d4fdaf2..f220670bd 100644 --- a/src/Squidex/app/shared/state/contents.state.ts +++ b/src/Squidex/app/shared/state/contents.state.ts @@ -12,6 +12,7 @@ import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/oper import { DateTime, DialogService, + ErrorDto, ImmutableArray, notify, Pager, @@ -152,7 +153,7 @@ export abstract class ContentsStateBase extends State { this.contentsService.changeContentStatus(this.appName, this.schemaName, c.id, action, dueTime, c.version).pipe( catchError(error => of(error))))).pipe( tap(results => { - const error = results.find(x => !!x.error); + const error = results.find(x => x instanceof ErrorDto); if (error) { this.dialogs.notifyError(error); @@ -169,7 +170,7 @@ export abstract class ContentsStateBase extends State { this.contentsService.deleteContent(this.appName, this.schemaName, c.id, c.version).pipe( catchError(error => of(error))))).pipe( tap(results => { - const error = results.find(x => !!x.error); + const error = results.find(x => x instanceof ErrorDto); if (error) { this.dialogs.notifyError(error); @@ -389,4 +390,4 @@ const discardChanges = (content: ContentDto, user: string, version: Version, now lastModified: now || DateTime.now(), lastModifiedBy: user, version - }); \ No newline at end of file + });