From 5a05a1b39f216344b8c1059edcf0b445ef7568f9 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Mon, 11 Jan 2021 14:44:52 -0600 Subject: [PATCH] UI: Fix shape of response anticipated from feature-flags endpoint (#10684) * Fix shape of response anticipated from feature-flags endpoint * Add changelog --- changelog/10684.txt | 3 +++ ui/app/routes/application.js | 2 +- ui/tests/acceptance/managed-namespace-test.js | 4 +--- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog/10684.txt diff --git a/changelog/10684.txt b/changelog/10684.txt new file mode 100644 index 000000000..3798d2e92 --- /dev/null +++ b/changelog/10684.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix expected response from feature-flags endpoint +``` diff --git a/ui/app/routes/application.js b/ui/app/routes/application.js index 7c36d1c54..29aca1bee 100644 --- a/ui/app/routes/application.js +++ b/ui/app/routes/application.js @@ -89,7 +89,7 @@ export default Route.extend({ }); if (result.status === 200) { const body = await result.json(); - const flags = body.data?.feature_flags || []; + const flags = body.feature_flags || []; this.featureFlagService.setFeatureFlags(flags); } }, diff --git a/ui/tests/acceptance/managed-namespace-test.js b/ui/tests/acceptance/managed-namespace-test.js index 0437c8dc8..894d6d1ab 100644 --- a/ui/tests/acceptance/managed-namespace-test.js +++ b/ui/tests/acceptance/managed-namespace-test.js @@ -4,9 +4,7 @@ import { setupApplicationTest } from 'ember-qunit'; import Pretender from 'pretender'; const FEATURE_FLAGS_RESPONSE = { - data: { - feature_flags: ['VAULT_CLOUD_ADMIN_NAMESPACE'], - }, + feature_flags: ['VAULT_CLOUD_ADMIN_NAMESPACE'], }; module('Acceptance | Enterprise | Managed namespace root', function(hooks) {