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;
|
||||
Reference in New Issue
Block a user