Skip to content

Commit

Permalink
fix database:settings:get/set (#2811)
Browse files Browse the repository at this point in the history
* fix settings:get/set

* changelog

* formatting is hard
  • Loading branch information
bkendall authored Nov 11, 2020
1 parent cd6e7ef commit d305caf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixes issue in `database:settings:get` where the value wasn't being properly displayed.
2 changes: 1 addition & 1 deletion src/apiv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class Client {
method: options.method,
};

if (options.json) {
if (options.json !== undefined) {
fetchOptions.body = JSON.stringify(options.json);
}

Expand Down
6 changes: 6 additions & 0 deletions src/commands/database-settings-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export default new Command("database:settings:get <path>")
original: err,
});
}
// strictTriggerValidation returns an object, not a single string.
// Check for an object and get the `value` from it.
if (typeof res.body === "object") {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
res.body = (res.body as any).value;
}
utils.logSuccess(`For database instance ${options.instance}\n\t ${path} = ${res.body}`);
}
);

0 comments on commit d305caf

Please sign in to comment.