mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Added action for change a feature toggle
This commit is contained in:
		
							parent
							
								
									56a0029b73
								
							
						
					
					
						commit
						4e1017bff5
					
				| @ -1,6 +1,6 @@ | |||||||
| import React, { PropTypes } from 'react'; | import React, { PropTypes } from 'react'; | ||||||
| import { connect } from 'react-redux'; | import { connect } from 'react-redux'; | ||||||
| import { updateFeatureToggle } from '../../store/feature-actions'; | import { editFeatureToggle } from '../../store/feature-actions'; | ||||||
| import AddFeatureToggleUI from './AddFeatureToggleUI'; | import AddFeatureToggleUI from './AddFeatureToggleUI'; | ||||||
| 
 | 
 | ||||||
| const mapStateToProps = (state, ownProps) => ({ | const mapStateToProps = (state, ownProps) => ({ | ||||||
| @ -34,7 +34,7 @@ class AddFeatureToggle extends React.Component { | |||||||
| 
 | 
 | ||||||
|     onSubmit = (evt) => { |     onSubmit = (evt) => { | ||||||
|         evt.preventDefault(); |         evt.preventDefault(); | ||||||
|         this.props.dispatch(updateFeatureToggle(this.state)); |         this.props.dispatch(editFeatureToggle(this.state)); | ||||||
|         this.context.router.push('/features'); |         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 () { | function requestFeatureToggles () { | ||||||
|     return { |     return { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user