eslint compliance on reducers & VOs
This commit is contained in:
parent
339c5397b0
commit
85b613c892
@ -4,12 +4,12 @@ import { AUTH_REQUEST, AUTH_SUCCESS, AUTH_FAILURE } from '../actions/auth';
|
||||
const auth = (state = null, action) => {
|
||||
switch (action.type) {
|
||||
case AUTH_REQUEST:
|
||||
return Immutable.Map({isFetching: true});
|
||||
return Immutable.Map({ isFetching: true });
|
||||
case AUTH_SUCCESS:
|
||||
return Immutable.fromJS({user: action.payload});
|
||||
return Immutable.fromJS({ user: action.payload });
|
||||
case AUTH_FAILURE:
|
||||
console.error(action.payload);
|
||||
return Immutable.Map({error: action.payload.toString()});
|
||||
return Immutable.Map({ error: action.payload.toString() });
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
@ -13,6 +13,6 @@ const collections = (state = null, action) => {
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default collections;
|
||||
|
@ -4,11 +4,11 @@ import { CONFIG_REQUEST, CONFIG_SUCCESS, CONFIG_FAILURE } from '../actions/confi
|
||||
const config = (state = null, action) => {
|
||||
switch (action.type) {
|
||||
case CONFIG_REQUEST:
|
||||
return Immutable.Map({isFetching: true});
|
||||
return Immutable.Map({ isFetching: true });
|
||||
case CONFIG_SUCCESS:
|
||||
return Immutable.fromJS(action.payload);
|
||||
case CONFIG_FAILURE:
|
||||
return Immutable.Map({error: action.payload.toString()});
|
||||
return Immutable.Map({ error: action.payload.toString() });
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
ENTRY_REQUEST, ENTRY_SUCCESS, ENTRIES_REQUEST, ENTRIES_SUCCESS
|
||||
} from '../actions/entries';
|
||||
|
||||
const entries = (state = Map({entities: Map(), pages: Map()}), action) => {
|
||||
const entries = (state = Map({ entities: Map(), pages: Map() }), action) => {
|
||||
switch (action.type) {
|
||||
case ENTRY_REQUEST:
|
||||
return state.setIn(['entities', `${action.payload.collection}.${action.payload.slug}`, 'isFetching'], true);
|
||||
|
@ -2,7 +2,7 @@ import { Map, List } from 'immutable';
|
||||
import { DRAFT_CREATE, DRAFT_DISCARD, DRAFT_CHANGE } from '../actions/entries';
|
||||
import { ADD_MEDIA, REMOVE_MEDIA } from '../actions/media';
|
||||
|
||||
const initialState = Map({entry: Map(), mediaFiles: List()});
|
||||
const initialState = Map({ entry: Map(), mediaFiles: List() });
|
||||
|
||||
const entryDraft = (state = Map(), action) => {
|
||||
switch (action.type) {
|
||||
|
@ -9,6 +9,6 @@ export default function MediaProxy(value, file, uploaded = false) {
|
||||
this.uploaded = uploaded;
|
||||
this.uri = config.media_folder && !uploaded ? config.media_folder + '/' + value : value;
|
||||
this.toString = function() {
|
||||
return this.uploaded ? this.uri : window.URL.createObjectURL(this.file, {oneTimeOnly: true});
|
||||
return this.uploaded ? this.uri : window.URL.createObjectURL(this.file, { oneTimeOnly: true });
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user