Added group verify to the reporting page RPS-74

This commit is contained in:
Patrick Fic
2021-02-17 17:40:31 -08:00
parent 969485ac03
commit 321ec92d91
7 changed files with 75 additions and 32 deletions

View File

@@ -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,
});

View File

@@ -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;
}

View File

@@ -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;