forked from Abdulbari/sgeUpdated
fixed issue GUI and Datacenter tab related
This commit is contained in:
33
sge-frontend/src/redux/reducers/emissionScope/index.js
Normal file
33
sge-frontend/src/redux/reducers/emissionScope/index.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const initialState = {
|
||||
emissionScopes: [],
|
||||
loading: false,
|
||||
error: null,
|
||||
};
|
||||
|
||||
const emissionScopeReducer = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case "GET_EMISSION_SCOPES_LOADING":
|
||||
return {
|
||||
...state,
|
||||
loading: true,
|
||||
error: null,
|
||||
};
|
||||
case "GET_EMISSION_SCOPES_SUCCESS":
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
emissionScopes: action.payload,
|
||||
error: null,
|
||||
};
|
||||
case "GET_EMISSION_SCOPES_ERROR":
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
error: action.payload.error,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default emissionScopeReducer;
|
||||
@@ -27,6 +27,7 @@ import surveys from "./surveys";
|
||||
import uploads from "./upload";
|
||||
import mailSettings from "./mailSettings";
|
||||
import dataCenter from "./dataCenter";
|
||||
import emissionScope from "./emissionScope";
|
||||
|
||||
const rootReducer = combineReducers({
|
||||
accessToken,
|
||||
@@ -57,6 +58,7 @@ const rootReducer = combineReducers({
|
||||
uploads,
|
||||
mailSettings,
|
||||
dataCenter,
|
||||
emissionScope,
|
||||
});
|
||||
|
||||
export default rootReducer;
|
||||
|
||||
Reference in New Issue
Block a user