UI: Fix shape of response anticipated from feature-flags endpoint (#10684)

* Fix shape of response anticipated from feature-flags endpoint

* Add changelog
This commit is contained in:
Chelsea Shaw 2021-01-11 14:44:52 -06:00 committed by GitHub
parent d72c4d5235
commit 5a05a1b39f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

3
changelog/10684.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: Fix expected response from feature-flags endpoint
```

View File

@ -89,7 +89,7 @@ export default Route.extend({
}); });
if (result.status === 200) { if (result.status === 200) {
const body = await result.json(); const body = await result.json();
const flags = body.data?.feature_flags || []; const flags = body.feature_flags || [];
this.featureFlagService.setFeatureFlags(flags); this.featureFlagService.setFeatureFlags(flags);
} }
}, },

View File

@ -4,9 +4,7 @@ import { setupApplicationTest } from 'ember-qunit';
import Pretender from 'pretender'; import Pretender from 'pretender';
const FEATURE_FLAGS_RESPONSE = { 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) { module('Acceptance | Enterprise | Managed namespace root', function(hooks) {