static-cms/src/actions/editor.js
Cássio Souza 48d8077ff0 Editorial workflow Improvements (#212)
* Merge conflicts automatically. Closes #208
* removed unpublished entry route
All entries (either under editorial workflow or not) go through the same edit route.
2017-01-11 20:58:15 -02:00

23 lines
543 B
JavaScript

import history from '../routing/history';
export const SWITCH_VISUAL_MODE = 'SWITCH_VISUAL_MODE';
export const CLOSED_ENTRY = 'CLOSED_ENTRY';
export function switchVisualMode(useVisualMode) {
return {
type: SWITCH_VISUAL_MODE,
payload: useVisualMode,
};
}
export function closeEntry(collection) {
return (dispatch) => {
if (collection && collection.get('name', false)) {
history.push(`collections/${ collection.get('name') }`);
} else {
history.goBack();
}
dispatch({ type: CLOSED_ENTRY });
};
}