diff --git a/server/server.js b/server/server.js index 267d378..92a30ff 100644 --- a/server/server.js +++ b/server/server.js @@ -72,8 +72,8 @@ io.use(function (socket, next) { }); // broadcast the message to a room - socket.on("send message", (msg, room) => { - io.in(room).emit("room message", msg); + socket.on("send message", (msg, room, userID) => { + io.in(room).emit("room message", msg, userID); }); // on disconnection diff --git a/server/src/controllers/tour_guide.controller.js b/server/src/controllers/tour_guide.controller.js index 34c7840..d382eb4 100644 --- a/server/src/controllers/tour_guide.controller.js +++ b/server/src/controllers/tour_guide.controller.js @@ -97,7 +97,11 @@ class TourGuideController { getAllTourGuide = async (req, res, next) => { try { - const allTourGuides = await TourGuide.findAll() + const allTourGuides = await User.findAll({ + where: { + role_user: RoleUser.GUIDER + } + }) return res.status(200).json({ message: "Get all tour guides successfully!", data: allTourGuides