1
0
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:
ivaosthu 2016-10-22 16:40:31 +02:00 committed by Ivar Conradi Østhus
parent 186fbc551d
commit 34aaf0ae8d
2 changed files with 8 additions and 2 deletions

View File

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

View File

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