Adicionado o metodo removeDir ante de remover o wbot

pull/1/head
adriano 2022-02-14 07:57:41 -03:00
parent de4877b31f
commit 4ccb5c5591
1 changed files with 3 additions and 3 deletions

View File

@ -120,6 +120,8 @@ export const remove = async (
await DeleteWhatsAppService(whatsappId); await DeleteWhatsAppService(whatsappId);
removeDir(path.join(process.cwd(),'WWebJS', `session-bd_${whatsappId}`))
removeWbot(+whatsappId); removeWbot(+whatsappId);
console.log('Deleteou o whatsapp service com id = ', whatsappId) console.log('Deleteou o whatsapp service com id = ', whatsappId)
@ -130,7 +132,5 @@ export const remove = async (
whatsappId: +whatsappId whatsappId: +whatsappId
}); });
removeDir(path.join(process.cwd(),'WWebJS', `session-bd_${whatsappId}`))
return res.status(200).json({ message: "Whatsapp deleted." }); return res.status(200).json({ message: "Whatsapp deleted." });
}; };