ShowBaileysChatService.ts 373 B

12345678910111213141516171819
  1. import AppError from "../../errors/AppError";
  2. import BaileysChats from "../../models/BaileysChats";
  3. export const ShowBaileysChatService = async (
  4. whatsappId: number,
  5. jid: string,
  6. ): Promise<BaileysChats> => {
  7. const baileysChat = await BaileysChats.findOne({
  8. where: {
  9. whatsappId,
  10. jid,
  11. }
  12. });
  13. if (baileysChat) {
  14. return baileysChat;
  15. }
  16. };