Compare commits

..

No commits in common. "ec6e84f56739d7d424f933258d27eafe69f0e782" and "2fc732eec17dd9d18fbeacb7bea4daaf8712f798" have entirely different histories.

3 changed files with 9 additions and 15 deletions

View File

@ -12,7 +12,7 @@ import DeleteUserService from "../services/UserServices/DeleteUserService";
import ListUser from "../services/UserServices/ListUserParamiterService";
import User from "../models/User";
import { del, get, set } from "../helpers/RedisClient";
import { get, set } from "../helpers/RedisClient";
import {
startWhoIsOnlineMonitor,
@ -27,7 +27,7 @@ import { splitDateTime } from "../helpers/SplitDateTime";
import ListUserByWhatsappQueuesService from "../services/UserServices/ListUserByWhatsappQueuesService";
import { json } from "sequelize";
import { getSettingValue } from "../helpers/WhaticketSettings";
import { setBotInfo } from "../helpers/SetBotInfo";
import { setBotInfo } from "../helpers/SetBotInfo"
type IndexQuery = {
searchParam: string;
@ -275,7 +275,7 @@ export const update = async (
let user: any = await UpdateUserService({ userData, userId });
await setBotInfo(user);
await setBotInfo(user)
if (user) {
const { id, name } = user;
@ -305,8 +305,6 @@ export const remove = async (
await DeleteUserService(userId);
del(`user:${userId}`);
const io = getIO();
io.emit("user", {
action: "delete",
@ -326,3 +324,5 @@ export const remove = async (
return res.status(200).json({ message: "User deleted" });
};

View File

@ -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 { del, get, set } from "../helpers/RedisClient";
import { get, set } from "../helpers/RedisClient";
interface WhatsappData {
name: string;
@ -230,9 +230,9 @@ export const weebhook = async (
req.body.entry[0].changes[0].value.metadata.display_phone_number;
let type = message.type;
const contact_to_exist = await get("whatsapp:*", `${contact_to}`);
const contact_from_exist = await get("whatsapp:*", `${contact_from}`);
if (contact_to_exist == null) {
if (!contact_from_exist) {
console.log(
"WHATSAPP OFFICIAL",
" | CONCTACT_FROM: ",
@ -514,8 +514,6 @@ export const remove = async (
});
}
await del(`whatsapp:${whatsappId}`);
let whats = await ListWhatsAppsNumber(whatsappId);
// Remove tickets business hours config

View File

@ -33,10 +33,6 @@ export async function get(key: string, value?: string) {
}
}
export async function del(key: string) {
await redis.del(key);
}
export async function clearAllKeys(...keys: string[]) {
for (const key of keys) {
// Retrieve all keys matching the pattern '*'