Reports: submit rule_ids to API
This commit is contained in:
parent
b8fb318c06
commit
9cbe98f131
|
@ -60,6 +60,7 @@ export function submitReport() {
|
||||||
return api(getState).post('/api/v1/reports', {
|
return api(getState).post('/api/v1/reports', {
|
||||||
account_id: getState().getIn(['reports', 'new', 'account_id']),
|
account_id: getState().getIn(['reports', 'new', 'account_id']),
|
||||||
status_ids: getState().getIn(['reports', 'new', 'status_ids']),
|
status_ids: getState().getIn(['reports', 'new', 'status_ids']),
|
||||||
|
rule_ids: getState().getIn(['reports', 'new', 'rule_ids']),
|
||||||
comment: getState().getIn(['reports', 'new', 'comment']),
|
comment: getState().getIn(['reports', 'new', 'comment']),
|
||||||
forward: getState().getIn(['reports', 'new', 'forward']),
|
forward: getState().getIn(['reports', 'new', 'forward']),
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,7 @@ const initialState = ImmutableMap({
|
||||||
comment: '',
|
comment: '',
|
||||||
forward: false,
|
forward: false,
|
||||||
block: false,
|
block: false,
|
||||||
rule_id: null,
|
rule_ids: ImmutableSet(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ export default function reports(state = initialState, action) {
|
||||||
case REPORT_BLOCK_CHANGE:
|
case REPORT_BLOCK_CHANGE:
|
||||||
return state.setIn(['new', 'block'], action.block);
|
return state.setIn(['new', 'block'], action.block);
|
||||||
case REPORT_RULE_CHANGE:
|
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:
|
case REPORT_SUBMIT_REQUEST:
|
||||||
return state.setIn(['new', 'isSubmitting'], true);
|
return state.setIn(['new', 'isSubmitting'], true);
|
||||||
case REPORT_SUBMIT_FAIL:
|
case REPORT_SUBMIT_FAIL:
|
||||||
|
@ -66,7 +66,7 @@ export default function reports(state = initialState, action) {
|
||||||
map.setIn(['new', 'status_ids'], ImmutableSet());
|
map.setIn(['new', 'status_ids'], ImmutableSet());
|
||||||
map.setIn(['new', 'comment'], '');
|
map.setIn(['new', 'comment'], '');
|
||||||
map.setIn(['new', 'isSubmitting'], false);
|
map.setIn(['new', 'isSubmitting'], false);
|
||||||
map.setIn(['new', 'rule_id'], null);
|
map.setIn(['new', 'rule_ids'], ImmutableSet());
|
||||||
map.setIn(['new', 'block'], false);
|
map.setIn(['new', 'block'], false);
|
||||||
});
|
});
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue