temp/src/redux/reducers/Reducer.jsx

50 lines
1.7 KiB
JavaScript

const initialState = {
attendenceAnomolyData : [],
partABatchAnomolyData : [],
systemNumber : null,
playGroundQuery : null,
playGroundResults : [],
playGroundtotalPages : 0,
playGroundCurrentPage : 0,
partCAnomolyList: [],
partCErrorList: [],
partCErrorData: [],
selectedError: null,
selectedErrorData: [],
selectedErrorJson: {},
};
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}
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}
case 'UPDATE_PARTC_ERROR_LIST':
return { ...state,partCErrorList:action?.payload}
case 'UPDATE_PARTC_ERROR_DATA':
return { ...state, partCErrorData:action?.payload}
case 'UPDATE_SELECTED_ERROR':
return { ...state, selectedError:action?.payload}
case 'UPDATE_SELECTED_ERROR_DATA':
return { ...state, selectedErrorData:action?.payload}
case 'UPDATE_SELECTED_ERROR_JSON':
return { ...state, selectedErrorJson:action?.payload}
default:
return state;
}
};
export default reducer;