Skip to content

Commit d305caf

Browse files
authored
fix database:settings:get/set (#2811)
* fix settings:get/set * changelog * formatting is hard
1 parent cd6e7ef commit d305caf

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixes issue in `database:settings:get` where the value wasn't being properly displayed.

src/apiv2.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export class Client {
245245
method: options.method,
246246
};
247247

248-
if (options.json) {
248+
if (options.json !== undefined) {
249249
fetchOptions.body = JSON.stringify(options.json);
250250
}
251251

src/commands/database-settings-get.ts

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ export default new Command("database:settings:get <path>")
4444
original: err,
4545
});
4646
}
47+
// strictTriggerValidation returns an object, not a single string.
48+
// Check for an object and get the `value` from it.
49+
if (typeof res.body === "object") {
50+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
51+
res.body = (res.body as any).value;
52+
}
4753
utils.logSuccess(`For database instance ${options.instance}\n\t ${path} = ${res.body}`);
4854
}
4955
);

0 commit comments

Comments
 (0)