dynamically create rooms chatboxes
This commit is contained in:
@@ -15,6 +15,15 @@ const chatController = {
|
||||
return res.status(500).json({ error: "Failed to create the room" });
|
||||
}
|
||||
},
|
||||
rooms: async (req, res) => {
|
||||
try {
|
||||
const rooms = await database.getRooms(req.session.publicKey);
|
||||
return res.status(200).json({ rooms: rooms });
|
||||
} catch (error) {
|
||||
console.error("Error fetching rooms:", error);
|
||||
return res.status(500).json({ error: "Error fetching rooms" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = chatController;
|
||||
|
||||
Reference in New Issue
Block a user