Skip to content

Commit ac6feb9

Browse files
authored
don't append query params if they don't contain data (#242)
1 parent 712cf25 commit ac6feb9

File tree

1 file changed

+12
-5
lines changed
  • src/api/resources/empathicVoice/resources/chat/client

1 file changed

+12
-5
lines changed

src/api/resources/empathicVoice/resources/chat/client/Client.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,28 @@ export class Chat {
4949
} else if (this._options.apiKey != null) {
5050
queryParams["apiKey"] = this._options.apiKey;
5151
}
52-
if (args.configId != null) {
52+
53+
if (args.configId !== null && args.configId !== undefined && args.configId !== "") {
5354
queryParams["config_id"] = args.configId;
5455
}
55-
if (args.configVersion != null) {
56+
57+
if (args.configVersion !== null && args.configVersion !== undefined && args.configVersion !== "") {
5658
queryParams["config_version"] = args.configVersion;
5759
}
58-
if (args.resumedChatGroupId != null) {
60+
61+
if (
62+
args.resumedChatGroupId !== null &&
63+
args.resumedChatGroupId !== undefined &&
64+
args.resumedChatGroupId !== ""
65+
) {
5966
queryParams["resumed_chat_group_id"] = args.resumedChatGroupId;
6067
}
6168

62-
if (args.verboseTranscription != null) {
69+
if (args.verboseTranscription !== null) {
6370
queryParams["verbose_transcription"] = args.verboseTranscription ? "true" : "false";
6471
}
6572

66-
if (args.queryParams != null) {
73+
if (args.queryParams !== null && args.queryParams !== undefined) {
6774
for (const [name, value] of Object.entries(args.queryParams)) {
6875
queryParams[name] = value;
6976
}

0 commit comments

Comments
 (0)