mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
fix: unwrap create strategy event creation (bug) (#4264)
<!-- Thanks for creating a PR! To make it easier for reviewers and everyone else to understand what your changes relate to, please add some relevant content to the headings below. Feel free to ignore or delete sections that you don't think are relevant. Thank you! ❤️ --> Fixes a bug around createStrategy Fix: Create/Store strategy reorder event only when feature is on ## About the changes <!-- Describe the changes introduced. What are they and why are they being introduced? Feel free to also add screenshots or steps to view the changes if they're visual. --> <!-- Does it close an issue? Multiple? --> Closes # <!-- (For internal contributors): Does it relate to an issue on public roadmap? --> <!-- Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item: # --> ### Important files <!-- PRs can contain a lot of changes, but not all changes are equally important. Where should a reviewer start looking to get an overview of the changes? Are any files particularly important? --> ## Discussion points <!-- Anything about the PR you'd like to discuss before it gets merged? Got any questions or doubts? --> Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
parent
b990c6dfe0
commit
dde8ba1a58
@ -563,22 +563,18 @@ class FeatureToggleService {
|
||||
segments,
|
||||
);
|
||||
|
||||
if (this.flagResolver.isEnabled('strategyVariant')) {
|
||||
const tags = await this.tagStore.getAllTagsForFeature(
|
||||
featureName,
|
||||
);
|
||||
const tags = await this.tagStore.getAllTagsForFeature(featureName);
|
||||
|
||||
await this.eventStore.store(
|
||||
new FeatureStrategyAddEvent({
|
||||
project: projectId,
|
||||
featureName,
|
||||
createdBy,
|
||||
environment,
|
||||
data: strategy,
|
||||
tags,
|
||||
}),
|
||||
);
|
||||
}
|
||||
await this.eventStore.store(
|
||||
new FeatureStrategyAddEvent({
|
||||
project: projectId,
|
||||
featureName,
|
||||
createdBy,
|
||||
environment,
|
||||
data: strategy,
|
||||
tags,
|
||||
}),
|
||||
);
|
||||
return strategy;
|
||||
} catch (e) {
|
||||
if (e.code === FOREIGN_KEY_VIOLATION) {
|
||||
|
Loading…
Reference in New Issue
Block a user