Reports: submit rule_ids to API
This commit is contained in:
parent
b8fb318c06
commit
9cbe98f131
2 changed files with 4 additions and 3 deletions
|
@ -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']),
|
||||
});
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue