From 192c292ecfc2ebc5082e92c62dbe197c6a94b5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Thu, 1 Oct 2020 22:34:28 +0200 Subject: [PATCH] fix: should use stripped update data for featureToggle --- lib/routes/admin-api/feature.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) {