mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 10:16:12 +01:00
feat: PUT /api/v3/chats/:roomId
This commit is contained in:
@@ -13,10 +13,12 @@ define('forum/chats', [
|
||||
'bootbox',
|
||||
'alerts',
|
||||
'chat',
|
||||
'api',
|
||||
], function (
|
||||
components, translator, mousetrap,
|
||||
recentChats, search, messages,
|
||||
autocomplete, hooks, bootbox, alerts, chatModule
|
||||
autocomplete, hooks, bootbox, alerts, chatModule,
|
||||
api
|
||||
) {
|
||||
const Chats = {
|
||||
initialised: false,
|
||||
@@ -345,14 +347,9 @@ define('forum/chats', [
|
||||
});
|
||||
|
||||
function submit() {
|
||||
socket.emit('modules.chats.renameRoom', {
|
||||
roomId: roomId,
|
||||
newName: modal.find('#roomName').val(),
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
alerts.error(err);
|
||||
}
|
||||
});
|
||||
api.put(`/chats/${roomId}`, {
|
||||
name: modal.find('#roomName').val(),
|
||||
}).catch(alerts.error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user