Added group verify to the reporting page RPS-74
This commit is contained in:
@@ -22,3 +22,7 @@ export const setReportingError = (data) => ({
|
||||
type: ReportingActionTypes.SET_REPORTING_ERROR,
|
||||
payload: data,
|
||||
});
|
||||
export const toggleGroupVerified = (jobId) => ({
|
||||
type: ReportingActionTypes.TOGGLE_GROUP_VERIFIED,
|
||||
payload: jobId,
|
||||
});
|
||||
|
||||
@@ -28,6 +28,17 @@ const applicationReducer = (state = INITIAL_STATE, action) => {
|
||||
return { ...state, data: action.payload };
|
||||
case ReportingActionTypes.SET_SCORE_CARD:
|
||||
return { ...state, loading: false, scoreCard: action.payload };
|
||||
case ReportingActionTypes.TOGGLE_GROUP_VERIFIED:
|
||||
return {
|
||||
...state,
|
||||
data: state.data.map((d) => {
|
||||
if (d.id === action.payload) {
|
||||
return { ...d, group_verified: !d.group_verified };
|
||||
} else {
|
||||
return d;
|
||||
}
|
||||
}),
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -4,5 +4,6 @@ const ReportingActionTypes = {
|
||||
SET_REPORTING_DATA: "SET_REPORTING_DATA",
|
||||
SET_SCORE_CARD: "SET_SCORE_CARD",
|
||||
SET_REPORTING_ERROR: "SET_REPORTING_ERROR",
|
||||
TOGGLE_GROUP_VERIFIED: "TOGGLE_GROUP_VERIFIED",
|
||||
};
|
||||
export default ReportingActionTypes;
|
||||
|
||||
Reference in New Issue
Block a user