import Whatsapp from "../../models/Whatsapp"; const ListWhatsAppsNumber = async (whatsappId: string | number, status: string): Promise => { const whatsapp = await Whatsapp.findOne({ raw: true, where: { id: whatsappId } }) if (whatsapp) { const whatsapps = await Whatsapp.findAll({ raw: true, where: { number: whatsapp.number, status: status }, attributes: ['id', 'number', 'status', 'isDefault'] }); return whatsapps; } return [] }; export default ListWhatsAppsNumber;