From 9cbe98f131659717a7f31fe49113486e3d6a59e5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 2 May 2022 14:39:08 -0500 Subject: [PATCH] Reports: submit rule_ids to API --- app/soapbox/actions/reports.js | 1 + app/soapbox/reducers/reports.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/soapbox/actions/reports.js b/app/soapbox/actions/reports.js index 9a23b51f4..69f9006de 100644 --- a/app/soapbox/actions/reports.js +++ b/app/soapbox/actions/reports.js @@ -60,6 +60,7 @@ export function submitReport() { return api(getState).post('/api/v1/reports', { account_id: getState().getIn(['reports', 'new', 'account_id']), status_ids: getState().getIn(['reports', 'new', 'status_ids']), + rule_ids: getState().getIn(['reports', 'new', 'rule_ids']), comment: getState().getIn(['reports', 'new', 'comment']), forward: getState().getIn(['reports', 'new', 'forward']), }); diff --git a/app/soapbox/reducers/reports.js b/app/soapbox/reducers/reports.js index 74ba75dd2..4103e4bf5 100644 --- a/app/soapbox/reducers/reports.js +++ b/app/soapbox/reducers/reports.js @@ -21,7 +21,7 @@ const initialState = ImmutableMap({ comment: '', forward: false, block: false, - rule_id: null, + rule_ids: ImmutableSet(), }), }); @@ -54,7 +54,7 @@ export default function reports(state = initialState, action) { case REPORT_BLOCK_CHANGE: return state.setIn(['new', 'block'], action.block); case REPORT_RULE_CHANGE: - return state.setIn(['new', 'rule_id'], action.rule_id); + return state.setIn(['new', 'rule_ids'], ImmutableSet([action.rule_id])); case REPORT_SUBMIT_REQUEST: return state.setIn(['new', 'isSubmitting'], true); case REPORT_SUBMIT_FAIL: @@ -66,7 +66,7 @@ export default function reports(state = initialState, action) { map.setIn(['new', 'status_ids'], ImmutableSet()); map.setIn(['new', 'comment'], ''); map.setIn(['new', 'isSubmitting'], false); - map.setIn(['new', 'rule_id'], null); + map.setIn(['new', 'rule_ids'], ImmutableSet()); map.setIn(['new', 'block'], false); }); default: