mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: should use stripped update data for featureToggle
This commit is contained in:
parent
0121a0e207
commit
192c292ecf
@ -90,6 +90,7 @@ class FeatureController extends Controller {
|
|||||||
try {
|
try {
|
||||||
await this.validateUniqueName(toggleName);
|
await this.validateUniqueName(toggleName);
|
||||||
const value = await featureShema.validateAsync(req.body);
|
const value = await featureShema.validateAsync(req.body);
|
||||||
|
|
||||||
await this.eventStore.store({
|
await this.eventStore.store({
|
||||||
type: FEATURE_CREATED,
|
type: FEATURE_CREATED,
|
||||||
createdBy: userName,
|
createdBy: userName,
|
||||||
@ -110,11 +111,11 @@ class FeatureController extends Controller {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await this.featureToggleStore.getFeature(featureName);
|
await this.featureToggleStore.getFeature(featureName);
|
||||||
await featureShema.validateAsync(updatedFeature);
|
const value = await featureShema.validateAsync(updatedFeature);
|
||||||
await this.eventStore.store({
|
await this.eventStore.store({
|
||||||
type: FEATURE_UPDATED,
|
type: FEATURE_UPDATED,
|
||||||
createdBy: userName,
|
createdBy: userName,
|
||||||
data: updatedFeature,
|
data: value,
|
||||||
});
|
});
|
||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user