fix: bug fixes from linters (#1524)
This commit is contained in:
@ -8,7 +8,7 @@ import { formatToExtension } from 'Formats/formats';
|
||||
|
||||
const collections = (state = null, action) => {
|
||||
switch (action.type) {
|
||||
case CONFIG_SUCCESS:
|
||||
case CONFIG_SUCCESS: {
|
||||
const configCollections = action.payload ? action.payload.get('collections') : List();
|
||||
return configCollections
|
||||
.toOrderedMap()
|
||||
@ -21,6 +21,7 @@ const collections = (state = null, action) => {
|
||||
}
|
||||
})
|
||||
.mapKeys((key, collection) => collection.get('name'));
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
@ -22,13 +22,14 @@ import { CONFIG_SUCCESS } from 'Actions/config';
|
||||
|
||||
const unpublishedEntries = (state = Map(), action) => {
|
||||
switch (action.type) {
|
||||
case CONFIG_SUCCESS:
|
||||
case CONFIG_SUCCESS: {
|
||||
const publishMode = action.payload && action.payload.get('publish_mode');
|
||||
if (publishMode === EDITORIAL_WORKFLOW) {
|
||||
// Editorial workflow state is explicetelly initiated after the config.
|
||||
return Map({ entities: Map(), pages: Map() });
|
||||
}
|
||||
return state;
|
||||
}
|
||||
case UNPUBLISHED_ENTRY_REQUEST:
|
||||
return state.setIn(['entities', `${ action.payload.collection }.${ action.payload.slug }`, 'isFetching'], true);
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { CONFIG_SUCCESS } from 'Actions/config';
|
||||
|
||||
const integrations = (state = null, action) => {
|
||||
switch (action.type) {
|
||||
case CONFIG_SUCCESS:
|
||||
case CONFIG_SUCCESS: {
|
||||
const integrations = action.payload.get('integrations', List()).toJS() || [];
|
||||
const newState = integrations.reduce((acc, integration) => {
|
||||
const { hooks, collections, provider, ...providerData } = integration;
|
||||
@ -23,6 +23,7 @@ const integrations = (state = null, action) => {
|
||||
return acc;
|
||||
}, { providers:{}, hooks: {} });
|
||||
return fromJS(newState);
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
Reference in New Issue
Block a user