mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
feat: show an alert when connection with whatsapp brokes
This commit is contained in:
@@ -2,6 +2,7 @@ import { Request, Response } from "express";
|
||||
import { getWbot } from "../libs/wbot";
|
||||
import ShowWhatsAppService from "../services/WhatsappService/ShowWhatsAppService";
|
||||
import { StartWhatsAppSession } from "../services/WbotServices/StartWhatsAppSession";
|
||||
import UpdateWhatsAppService from "../services/WhatsappService/UpdateWhatsAppService";
|
||||
|
||||
const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
const { whatsappId } = req.params;
|
||||
@@ -14,9 +15,11 @@ const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
|
||||
const update = async (req: Request, res: Response): Promise<Response> => {
|
||||
const { whatsappId } = req.params;
|
||||
const whatsapp = await ShowWhatsAppService(whatsappId);
|
||||
|
||||
await whatsapp.update({ session: "" });
|
||||
const { whatsapp } = await UpdateWhatsAppService({
|
||||
whatsappId,
|
||||
whatsappData: { session: "" }
|
||||
});
|
||||
|
||||
StartWhatsAppSession(whatsapp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user