mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
enabled socket io in settings controller
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { Request, Response } from "express";
|
||||
|
||||
import { getIO } from "../libs/socket";
|
||||
import AppError from "../errors/AppError";
|
||||
|
||||
import UpdateSettingService from "../services/SettingServices/UpdateSettingService";
|
||||
import ListSettingsService from "../services/SettingServices/ListSettingsService";
|
||||
// const { getIO } = require("../libs/socket");
|
||||
|
||||
export const index = async (req: Request, res: Response): Promise<Response> => {
|
||||
if (req.user.profile !== "admin") {
|
||||
@@ -31,11 +31,11 @@ export const update = async (
|
||||
value
|
||||
});
|
||||
|
||||
// const io = getIO();
|
||||
// io.emit("settings", {
|
||||
// action: "update",
|
||||
// setting
|
||||
// });
|
||||
const io = getIO();
|
||||
io.emit("settings", {
|
||||
action: "update",
|
||||
setting
|
||||
});
|
||||
|
||||
return res.status(200).json(setting);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user