Skip to content

Commit 43a8b34

Browse files
committed
Merge branch 'release/1.2.0-1'
2 parents be54331 + 6005d33 commit 43a8b34

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

src/whatsapp/controllers/instance.controller.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,7 @@ export class InstanceController {
9797
}
9898
}
9999

100-
if (
101-
!chatwoot_account_id ||
102-
!chatwoot_token ||
103-
!chatwoot_url ||
104-
!chatwoot_sign_msg
105-
) {
100+
if (!chatwoot_account_id || !chatwoot_token || !chatwoot_url) {
106101
this.logger.verbose('instance created');
107102
this.logger.verbose({
108103
instance: {
@@ -137,10 +132,6 @@ export class InstanceController {
137132
throw new BadRequestException('url is required');
138133
}
139134

140-
if (!chatwoot_sign_msg) {
141-
throw new BadRequestException('sign_msg is required');
142-
}
143-
144135
const urlServer = this.configService.get<HttpServer>('SERVER').URL;
145136

146137
try {
@@ -149,7 +140,7 @@ export class InstanceController {
149140
account_id: chatwoot_account_id,
150141
token: chatwoot_token,
151142
url: chatwoot_url,
152-
sign_msg: chatwoot_sign_msg,
143+
sign_msg: chatwoot_sign_msg || false,
153144
name_inbox: instance.instanceName,
154145
});
155146

@@ -174,7 +165,7 @@ export class InstanceController {
174165
account_id: chatwoot_account_id,
175166
token: chatwoot_token,
176167
url: chatwoot_url,
177-
sign_msg: chatwoot_sign_msg,
168+
sign_msg: chatwoot_sign_msg || false,
178169
name_inbox: instance.instanceName,
179170
webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`,
180171
},
@@ -227,12 +218,7 @@ export class InstanceController {
227218
}
228219
}
229220

230-
if (
231-
!chatwoot_account_id ||
232-
!chatwoot_token ||
233-
!chatwoot_url ||
234-
!chatwoot_sign_msg
235-
) {
221+
if (!chatwoot_account_id || !chatwoot_token || !chatwoot_url) {
236222
let getQrcode: wa.QrCode;
237223

238224
if (qrcode) {
@@ -280,10 +266,6 @@ export class InstanceController {
280266
throw new BadRequestException('url is required');
281267
}
282268

283-
if (!chatwoot_sign_msg) {
284-
throw new BadRequestException('sign_msg is required');
285-
}
286-
287269
const urlServer = this.configService.get<HttpServer>('SERVER').URL;
288270

289271
try {
@@ -292,7 +274,7 @@ export class InstanceController {
292274
account_id: chatwoot_account_id,
293275
token: chatwoot_token,
294276
url: chatwoot_url,
295-
sign_msg: chatwoot_sign_msg,
277+
sign_msg: chatwoot_sign_msg || false,
296278
name_inbox: instance.instanceName,
297279
});
298280

@@ -320,7 +302,7 @@ export class InstanceController {
320302
account_id: chatwoot_account_id,
321303
token: chatwoot_token,
322304
url: chatwoot_url,
323-
sign_msg: chatwoot_sign_msg,
305+
sign_msg: chatwoot_sign_msg || false,
324306
name_inbox: instance.instanceName,
325307
webhook_url: `${urlServer}/chatwoot/webhook/${instance.instanceName}`,
326308
},

0 commit comments

Comments
 (0)