forked from BLC/sgeUpdated
Fix DataCenter emission calculation: VM-level processing, authentication fixes, and type safety improvements
This commit is contained in:
58
src/redux/reducers/datas/index.js
Normal file
58
src/redux/reducers/datas/index.js
Normal file
@@ -0,0 +1,58 @@
|
||||
const initialState = {
|
||||
sectors: [],
|
||||
sector: [],
|
||||
subSectors: [],
|
||||
subSector: [],
|
||||
activitySubUnits: [],
|
||||
consuptionUnits: [],
|
||||
emissionScopes: [],
|
||||
gpcReferences: [],
|
||||
mcfTypes: [],
|
||||
};
|
||||
|
||||
const datasReducer = (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case "GET_SECTORS":
|
||||
return {
|
||||
...state,
|
||||
sectors: action.payload.sectors,
|
||||
};
|
||||
case "GET_SECTOR_BY_ID":
|
||||
return {
|
||||
...state,
|
||||
sector: action.payload.sector,
|
||||
};
|
||||
case "GET_SUBSECTORS":
|
||||
return {
|
||||
...state,
|
||||
subSectors: action.payload.subSectors,
|
||||
};
|
||||
case "GET_SUBSECTOR_BY_ID":
|
||||
return {
|
||||
...state,
|
||||
subSector: action.payload.subSector,
|
||||
};
|
||||
case "GET_ACTIVITY_SUBUNITS":
|
||||
return {
|
||||
...state,
|
||||
activitySubUnits: action.payload.activitySubUnits,
|
||||
};
|
||||
case "GET_CONSUPTION_UNITS":
|
||||
return {
|
||||
...state,
|
||||
consuptionUnits: action.payload.consuptionUnits,
|
||||
};
|
||||
case "GET_GPC_REFERENCES":
|
||||
return {
|
||||
...state,
|
||||
gpcReferences: action.payload.gpcReferences,
|
||||
};
|
||||
case "GET_MCF_TYPES":
|
||||
return {
|
||||
...state,
|
||||
mcfTypes: action.payload.mcfTypes,
|
||||
};
|
||||
}
|
||||
return state;
|
||||
};
|
||||
export default datasReducer;
|
||||
Reference in New Issue
Block a user