stop navigation on failed entry save in editorial workflow

This commit is contained in:
Shawn Erquhart 2017-10-26 13:37:09 -04:00
parent daa5395346
commit 3d65cc380e

View File

@ -227,7 +227,7 @@ export function persistUnpublishedEntry(collection, existingUnpublishedEntry) {
const entryDraft = state.entryDraft; const entryDraft = state.entryDraft;
// Early return if draft contains validation errors // 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 backend = currentBackend(state.config);
const transactionID = uuid(); const transactionID = uuid();
@ -260,7 +260,7 @@ export function persistUnpublishedEntry(collection, existingUnpublishedEntry) {
kind: 'danger', kind: 'danger',
dismissAfter: 8000, dismissAfter: 8000,
})); }));
return dispatch(unpublishedEntryPersistedFail(error, transactionID)); return Promise.reject(dispatch(unpublishedEntryPersistedFail(error, transactionID)));
}); });
}; };
} }