From ab1c89631e79c7158802b1a59ee8837cac304c1b Mon Sep 17 00:00:00 2001 From: adriano Date: Thu, 22 Dec 2022 09:15:30 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20no=20codigo=20para=20funci?= =?UTF-8?q?onamento=20do=20AutoRestore=20quando=20o=20status=20da=20conex?= =?UTF-8?q?=C3=A3o=20estiver=20no=20status=20Pending?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/controllers/ContactController.ts | 6 +++--- .../WbotServices/StartWhatsAppSession.ts | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/backend/src/controllers/ContactController.ts b/backend/src/controllers/ContactController.ts index 43db780..7460b2d 100644 --- a/backend/src/controllers/ContactController.ts +++ b/backend/src/controllers/ContactController.ts @@ -41,7 +41,7 @@ export const index = async (req: Request, res: Response): Promise => { console.log('PAGE NUMBER CONTACT: ', pageNumber) - if ( pageNumber === undefined || pageNumber.trim().length == 0) { + if (pageNumber === undefined || pageNumber.trim().length == 0) { pageNumber = '1' } @@ -90,7 +90,7 @@ export const store = async (req: Request, res: Response): Promise => { try { await schema.validate(newContact); - } catch (err) { + } catch (err: any) { throw new AppError(err.message); } @@ -145,7 +145,7 @@ export const update = async ( try { await schema.validate(contactData); - } catch (err) { + } catch (err: any) { throw new AppError(err.message); } diff --git a/backend/src/services/WbotServices/StartWhatsAppSession.ts b/backend/src/services/WbotServices/StartWhatsAppSession.ts index 05cd425..907d28e 100644 --- a/backend/src/services/WbotServices/StartWhatsAppSession.ts +++ b/backend/src/services/WbotServices/StartWhatsAppSession.ts @@ -60,14 +60,14 @@ export const StartWhatsAppSession = async (whatsapp: Whatsapp, backupSession: bo const _whatsapp = await Whatsapp.findOne({ where: { id: autoR.whatsappId } }); let whatsappStatus = ["CONFLICT", - "DEPRECATED_VERSION ", - "OPENING ", - "PROXYBLOCK ", - "SMB_TOS_BLOCK ", - "TIMEOUT ", - "TOS_BLOCK ", - "UNLAUNCHED ", - "UNPAIRED ", + "DEPRECATED_VERSION", + "OPENING", + "PROXYBLOCK", + "SMB_TOS_BLOCK", + "TIMEOUT", + "TOS_BLOCK", + "UNLAUNCHED", + "UNPAIRED", "UNPAIRED_IDLE"] if (_whatsapp?.status) {