func (interactor *FeatureService) AddFeature(newFeature m.FeatureFlag) error {
	return interactor.DB.Update(func(tx *bolt.Tx) error {

		feature, err := repos.GetFeature(tx, newFeature.Key)
		if err != nil && err.Error() != "Unable to find feature" {
			return err
		}

		if len(feature.Key) > 0 {
			return fmt.Errorf("Feature already exists")
		}

		return repos.PutFeature(tx, newFeature)
	})
}
// Store a new feature flag in the database
Store a new feature flag in the database
// Store a new feature flag in the database
func (interactor *FeatureService) AddFeature(newFeature m.FeatureFlag) error {
	return interactor.DB.Update(func(tx *bolt.Tx) error {
		feature, err := repos.GetFeature(tx, newFeature.Key)
		if err != nil && err.Error() != "Unable to find feature" {
			return err
		}
		if len(feature.Key) > 0 {
			return fmt.Errorf("Feature already exists")
		}
		return repos.PutFeature(tx, newFeature)
	})
}
func ( interactor * FeatureService ) AddFeature ( newFeature m . FeatureFlag ) error { return interactor . DB . Update ( func ( tx * bolt . Tx ) error { feature , err := repos . GetFeature ( tx , newFeature . Key ) if err != nil && err . Error ( ) != " " { return err } if len ( feature . Key ) > 0 { return fmt . Errorf ( " " ) } return repos . PutFeature ( tx , newFeature ) } ) }
Store a new feature flag in the database
Store a new feature flag in the database