temp/src/redux/reducers/Reducer.jsx

34 lines
1.1 KiB
React
Raw Normal View History

2024-06-11 18:18:19 +05:30
const initialState = {
attendenceAnomolyData : [],
partABatchAnomolyData : [],
2024-06-25 14:41:11 +05:30
systemNumber : null,
playGroundQuery : null,
playGroundResults : [],
playGroundtotalPages : 0,
playGroundCurrentPage : 0
2024-06-11 18:18:19 +05:30
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case 'UPDATE_ATTENDENCE_ANOMOLY_DATA':
return { ...state, attendenceAnomolyData:action?.payload};
case 'UPDATE_PART-A_ANOMOLY_DATA':
return { ...state, partABatchAnomolyData:action?.payload};
case 'UPDATE_SYSTEM_NO':
return { ...state,systemNumber:action?.payload}
2024-06-25 14:41:11 +05:30
case 'UPDATE_PLAYGROUND_QUERY':
return { ...state,playGroundQuery:action?.payload}
case 'UPDATE_PLAYGROUND_RESULTS':
return { ...state,playGroundResults:action?.payload}
case 'UPDATE_PLAYGROUND_PAGENO':
return { ...state,playGroundtotalPages:action?.payload}
case 'UPDATE_PLAYGROUND_TOTAL_PAGES':
return { ...state,playGroundCurrentPage:action?.payload}
2024-06-11 18:18:19 +05:30
default:
return state;
}
};
export default reducer;