forked from Abdulbari/sgeUpdated
Add 'sge-frontend/' from commit '5fa787e054b25ac53edc7ff0275ea7960a709401'
git-subtree-dir: sge-frontend git-subtree-mainline:876c278ac4git-subtree-split:5fa787e054
This commit is contained in:
58
sge-frontend/src/redux/reducers/datas/index.js
Normal file
58
sge-frontend/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