From 3d65cc380e401cc442506de519a83cc60fe14927 Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Thu, 26 Oct 2017 13:37:09 -0400 Subject: [PATCH] stop navigation on failed entry save in editorial workflow --- src/actions/editorialWorkflow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/editorialWorkflow.js b/src/actions/editorialWorkflow.js index 9b0082fb..9b3d0e32 100644 --- a/src/actions/editorialWorkflow.js +++ b/src/actions/editorialWorkflow.js @@ -227,7 +227,7 @@ export function persistUnpublishedEntry(collection, existingUnpublishedEntry) { const entryDraft = state.entryDraft; // Early return if draft contains validation errors - if (!entryDraft.get('fieldsErrors').isEmpty()) return Promise.resolve(); + if (!entryDraft.get('fieldsErrors').isEmpty()) return Promise.reject(); const backend = currentBackend(state.config); const transactionID = uuid(); @@ -260,7 +260,7 @@ export function persistUnpublishedEntry(collection, existingUnpublishedEntry) { kind: 'danger', dismissAfter: 8000, })); - return dispatch(unpublishedEntryPersistedFail(error, transactionID)); + return Promise.reject(dispatch(unpublishedEntryPersistedFail(error, transactionID))); }); }; }