mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
Added action for change a feature toggle
This commit is contained in:
parent
186fbc551d
commit
34aaf0ae8d
@ -1,6 +1,6 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { updateFeatureToggle } from '../../store/feature-actions';
|
||||
import { editFeatureToggle } from '../../store/feature-actions';
|
||||
import AddFeatureToggleUI from './AddFeatureToggleUI';
|
||||
|
||||
const mapStateToProps = (state, ownProps) => ({
|
||||
@ -34,7 +34,7 @@ class AddFeatureToggle extends React.Component {
|
||||
|
||||
onSubmit = (evt) => {
|
||||
evt.preventDefault();
|
||||
this.props.dispatch(updateFeatureToggle(this.state));
|
||||
this.props.dispatch(editFeatureToggle(this.state));
|
||||
this.context.router.push('/features');
|
||||
};
|
||||
|
||||
|
@ -50,6 +50,12 @@ export function toggleFeature (featureToggle) {
|
||||
};
|
||||
};
|
||||
|
||||
export function editFeatureToggle (featureToggle) {
|
||||
debug('Update feature toggle ', featureToggle);
|
||||
return dispatch => {
|
||||
dispatch(requestUpdateFeatureToggle(featureToggle));
|
||||
};
|
||||
};
|
||||
|
||||
function requestFeatureToggles () {
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user