updated format and lint scripts and applied them
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user