From ec6e84f56739d7d424f933258d27eafe69f0e782 Mon Sep 17 00:00:00 2001 From: adriano Date: Thu, 7 Mar 2024 11:53:50 -0300 Subject: [PATCH] feat: Add function in controller to remove whatsapp cache in Redis --- backend/src/controllers/WhatsAppController.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/controllers/WhatsAppController.ts b/backend/src/controllers/WhatsAppController.ts index e8e0499..4e10e1e 100644 --- a/backend/src/controllers/WhatsAppController.ts +++ b/backend/src/controllers/WhatsAppController.ts @@ -42,7 +42,7 @@ import { getSettingValue } from "../helpers/WhaticketSettings"; import ListWhatsAppsNumber from "../services/WhatsappService/ListWhatsAppsNumber"; import SettingTicket from "../models/SettingTicket"; import { Op } from "sequelize"; -import { get, set } from "../helpers/RedisClient"; +import { del, get, set } from "../helpers/RedisClient"; interface WhatsappData { name: string; @@ -514,6 +514,8 @@ export const remove = async ( }); } + await del(`whatsapp:${whatsappId}`); + let whats = await ListWhatsAppsNumber(whatsappId); // Remove tickets business hours config