updated format and lint scripts and applied them

This commit is contained in:
JJ Kasper
2018-06-01 16:52:12 -05:00
parent 53ac8a6793
commit 017a9993ee
58 changed files with 1711 additions and 1568 deletions

View File

@@ -1,9 +1,9 @@
import {
SET_USER,
import {
SET_USER,
LOGIN_PENDING,
LOGIN_FAILED,
LOGOUT
} from '../actions/userAct';
LOGOUT,
} from '../actions/userAct'
const initState = {
setup: false,
@@ -11,35 +11,36 @@ const initState = {
email: null,
admin: null,
pending: false,
error: null
};
error: null,
}
function user(state=initState, action) {
switch(action.type) {
case SET_USER: {
return {
...initState,
...action.data
};
}
case LOGIN_PENDING: {
return {
...initState,
pending: true
};
}
case LOGIN_FAILED: {
return {
...state,
pending: false,
error: action.data
};
}
case LOGOUT: {
return initState;
}
default: return state;
function user(state = initState, action) {
switch (action.type) {
case SET_USER: {
return {
...initState,
...action.data,
}
}
case LOGIN_PENDING: {
return {
...initState,
pending: true,
}
}
case LOGIN_FAILED: {
return {
...state,
pending: false,
error: action.data,
}
}
case LOGOUT: {
return initState
}
default:
return state
}
}
export default user;
export default user