[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix database:settings:get/set #2811

Merged
merged 3 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix settings:get/set
  • Loading branch information
bkendall committed Nov 11, 2020
commit 2eeeb383ee817d8945caaa02b08b29a706d6cd4c
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}`);
}
);