Update profile.js

This commit is contained in:
Andrean
2023-05-08 16:47:51 +00:00
committed by GitHub
parent 7275b966b4
commit 27c1f07cd5
+1 -32
View File
@@ -5,24 +5,16 @@ import {
UPDATE_PROFILE,
GET_PROFILES,
GET_REPOS,
<<<<<<< HEAD
NO_REPOS
} from '../actions/types';
=======
NO_REPOS,
} from "../actions/types";
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
const initialState = {
profile: null,
profiles: [],
repos: [],
loading: true,
<<<<<<< HEAD
error: {}
=======
error: {},
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
};
function profileReducer(state = initialState, action) {
@@ -34,61 +26,38 @@ function profileReducer(state = initialState, action) {
return {
...state,
profile: payload,
<<<<<<< HEAD
loading: false
=======
loading: false,
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
};
case GET_PROFILES:
return {
...state,
profiles: payload,
<<<<<<< HEAD
loading: false
=======
loading: false,
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
};
case PROFILE_ERROR:
return {
...state,
error: payload,
loading: false,
<<<<<<< HEAD
profile: null
=======
profile: null,
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
};
case CLEAR_PROFILE:
return {
...state,
profile: null,
<<<<<<< HEAD
repos: []
=======
repos: [],
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
};
case GET_REPOS:
return {
...state,
repos: payload,
<<<<<<< HEAD
loading: false
=======
loading: false,
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
};
case NO_REPOS:
return {
...state,
<<<<<<< HEAD
repos: []
=======
repos: [],
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
};
default:
return state;