Skip to content

Commit

Permalink
fix typing/recording events on correct ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Jul 6, 2024
1 parent aaf64bb commit 67aa41c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/src/libs/wbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { StartWhatsAppSession } from "../services/WbotServices/StartWhatsAppSess
import DeleteBaileysService from "../services/BaileysServices/DeleteBaileysService";
import Contact from "../models/Contact";
import Ticket from "../models/Ticket";
import { Op } from "sequelize";

const loggerBaileys = MAIN_LOGGER.child({});
loggerBaileys.level = "error";
Expand Down Expand Up @@ -281,7 +282,11 @@ export const initWASocket = async (whatsapp: Whatsapp): Promise<Session> => {
}
const ticket = await Ticket.findOne({
where: {
contactId: contact.id
contactId: contact.id,
whatsappId: whatsapp.id,
status: {
[Op.or]: ["open", "pending"]
}
}
});

Expand Down

0 comments on commit 67aa41c

Please sign in to comment.