Skip to content

Commit

Permalink
Merge pull request #28 from DucHuy2801/fix-bug
Browse files Browse the repository at this point in the history
Update socket & getAllTourGuides
  • Loading branch information
augustus281 authored May 21, 2024
2 parents e22d8af + 16a9936 commit c178403
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion server/src/controllers/tour_guide.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c178403

Please sign in to comment.