Skip to content

Commit 3319fef

Browse files
committed
fix(getFeatureFlag): fix env querystring issue
1 parent ce3a30a commit 3319fef

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ldutils

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ new LaunchDarklyUtils().create(process.env.LAUNCHDARKLY_API_TOKEN, log).then(fun
3737
program
3838
.command(`getFeatureFlag <projectKey> <featureFlagKey> [environmentKeyQuery]`)
3939
.description('get a single flag - with optional env')
40-
.action(function(projectKey, featureFlagKey) {
41-
ldUtils.flags.getFeatureFlag(projectKey, featureFlagKey).then(function(response) {
40+
.action(function(projectKey, featureFlagKey, environmentKeyQuery) {
41+
ldUtils.flags.getFeatureFlag(projectKey, featureFlagKey, environmentKeyQuery).then(function(response) {
4242
console.log(json.plain(response));
4343
});
4444
});

src/LaunchDarklyUtilsFlags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class LaunchDarklyUtilsFlags {
6666
.getFeatureFlag({
6767
projectKey: projectKey,
6868
featureFlagKey: featureFlagKey,
69-
environmentKeyQuery: environmentKeyQuery
69+
env: environmentKeyQuery
7070
})
7171
.then(response => {
7272
return response.body;

test/LaunchDarklyUtilsFlags.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('LaunchDarklyUtilsFlags', function() {
5555
describe('getFeatureFlagState', function() {
5656
before(done => {
5757
let scope = nock('https://app.launchdarkly.com')
58-
.get('/api/v2/flags/sample-project/sort.order')
58+
.get('/api/v2/flags/sample-project/sort.order?env=test')
5959
.replyWithFile(200, __dirname + '/fixtures/feature-flags-get.json', {
6060
'Content-Type': 'application/json'
6161
});

0 commit comments

Comments
 (0)