Skip to content

Commit

Permalink
removal of restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
jrCleber committed Aug 16, 2024
1 parent d557a2d commit 7ee40d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ tags:
description: Management of chatbot sessions on the Typebot platform.

servers:
- url: https://{{prod_host}}
- url: https://{prod_host}
variables:
prod_host:
default: apiv1.codechat.dev
- url: http://{{dev_host}}
- url: http://{dev_host}
variables:
dev_host:
default: 127.0.0.1:8084
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "tsc",
"start": "ts-node --files --transpile-only ./src/main.ts",
"start:prod": "bash start.sh",
"start:dev": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts",
"start:dev": "cls && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts",
"test": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts"
},
"repository": {
Expand Down
13 changes: 4 additions & 9 deletions src/whatsapp/services/whatsapp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,7 @@ export class WAStartupService {
const eventDesc = WebhookEventsEnum[event];

try {
if (
this.webhook?.enabled &&
isURL(this.webhook?.url, { protocols: ['http', 'https'] })
) {
if (this.webhook?.enabled) {
if (this.webhook?.events && this.webhook?.events[event]) {
await axios.post(
this.webhook.url,
Expand Down Expand Up @@ -469,11 +466,9 @@ export class WAStartupService {

private async getMessage(key: PrismType.Message, full = false) {
try {
key.instanceId = this.instance.id;
const message = await this.repository.message.findFirst({
where: {
instanceId: this.instance.id,
keyId: key.keyId,
},
where: key as any,
});
const webMessageInfo: Partial<proto.WebMessageInfo> = {
key: {
Expand Down Expand Up @@ -1933,7 +1928,7 @@ export class WAStartupService {
: ((await this.getMessage(m, true)) as proto.IWebMessageInfo);

for (const subtype of MessageSubtype) {
if (msg.message[subtype]) {
if (msg?.message?.[subtype]) {
msg.message = msg.message[subtype].message;
}
}
Expand Down

0 comments on commit 7ee40d1

Please sign in to comment.