Update profile.js
This commit is contained in:
@@ -5,24 +5,16 @@ import {
|
|||||||
UPDATE_PROFILE,
|
UPDATE_PROFILE,
|
||||||
GET_PROFILES,
|
GET_PROFILES,
|
||||||
GET_REPOS,
|
GET_REPOS,
|
||||||
<<<<<<< HEAD
|
|
||||||
NO_REPOS
|
NO_REPOS
|
||||||
} from '../actions/types';
|
} from '../actions/types';
|
||||||
=======
|
|
||||||
NO_REPOS,
|
|
||||||
} from "../actions/types";
|
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
profile: null,
|
profile: null,
|
||||||
profiles: [],
|
profiles: [],
|
||||||
repos: [],
|
repos: [],
|
||||||
loading: true,
|
loading: true,
|
||||||
<<<<<<< HEAD
|
|
||||||
error: {}
|
|
||||||
=======
|
|
||||||
error: {},
|
error: {},
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function profileReducer(state = initialState, action) {
|
function profileReducer(state = initialState, action) {
|
||||||
@@ -34,61 +26,38 @@ function profileReducer(state = initialState, action) {
|
|||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
profile: payload,
|
profile: payload,
|
||||||
<<<<<<< HEAD
|
|
||||||
loading: false
|
|
||||||
=======
|
|
||||||
loading: false,
|
loading: false,
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
};
|
};
|
||||||
case GET_PROFILES:
|
case GET_PROFILES:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
profiles: payload,
|
profiles: payload,
|
||||||
<<<<<<< HEAD
|
|
||||||
loading: false
|
|
||||||
=======
|
|
||||||
loading: false,
|
loading: false,
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
};
|
};
|
||||||
case PROFILE_ERROR:
|
case PROFILE_ERROR:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
error: payload,
|
error: payload,
|
||||||
loading: false,
|
loading: false,
|
||||||
<<<<<<< HEAD
|
|
||||||
profile: null
|
profile: null
|
||||||
=======
|
|
||||||
profile: null,
|
profile: null,
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
};
|
};
|
||||||
case CLEAR_PROFILE:
|
case CLEAR_PROFILE:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
profile: null,
|
profile: null,
|
||||||
<<<<<<< HEAD
|
|
||||||
repos: []
|
repos: []
|
||||||
=======
|
|
||||||
repos: [],
|
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
};
|
};
|
||||||
case GET_REPOS:
|
case GET_REPOS:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
repos: payload,
|
repos: payload,
|
||||||
<<<<<<< HEAD
|
|
||||||
loading: false
|
|
||||||
=======
|
|
||||||
loading: false,
|
loading: false,
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
};
|
};
|
||||||
case NO_REPOS:
|
case NO_REPOS:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
<<<<<<< HEAD
|
|
||||||
repos: []
|
|
||||||
=======
|
|
||||||
repos: [],
|
repos: [],
|
||||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
Reference in New Issue
Block a user