mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
feat: log roomId/roomName on delete
This commit is contained in:
@@ -34,10 +34,16 @@ Admin.getAnalyticsData = async (req, res) => {
|
||||
Admin.chats = {};
|
||||
|
||||
Admin.chats.deleteRoom = async (req, res) => {
|
||||
const roomData = await messaging.getRoomData(req.params.roomId);
|
||||
if (!roomData) {
|
||||
throw new Error('[[error:no-room]]');
|
||||
}
|
||||
await messaging.deleteRooms([req.params.roomId]);
|
||||
|
||||
events.log({
|
||||
type: 'chat-room-deleted',
|
||||
roomId: req.params.roomId,
|
||||
roomName: roomData.roomName ? roomData.roomName : `No room name`,
|
||||
uid: req.uid,
|
||||
ip: req.ip,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user