diff --git a/lib/routes/admin-api/feature.js b/lib/routes/admin-api/feature.js index d07ef7fc79..ad83c18718 100644 --- a/lib/routes/admin-api/feature.js +++ b/lib/routes/admin-api/feature.js @@ -90,6 +90,7 @@ class FeatureController extends Controller { try { await this.validateUniqueName(toggleName); const value = await featureShema.validateAsync(req.body); + await this.eventStore.store({ type: FEATURE_CREATED, createdBy: userName, @@ -110,11 +111,11 @@ class FeatureController extends Controller { try { await this.featureToggleStore.getFeature(featureName); - await featureShema.validateAsync(updatedFeature); + const value = await featureShema.validateAsync(updatedFeature); await this.eventStore.store({ type: FEATURE_UPDATED, createdBy: userName, - data: updatedFeature, + data: value, }); res.status(200).end(); } catch (error) {