mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: remove sockets.reqFromSocket
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
const posts = require('../../posts');
|
||||
const user = require('../../user');
|
||||
const privileges = require('../../privileges');
|
||||
const apiHelpers = require('../../api/helpers');
|
||||
const websockets = require('..');
|
||||
|
||||
module.exports = function (SocketPosts) {
|
||||
@@ -55,7 +56,7 @@ module.exports = function (SocketPosts) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
}
|
||||
|
||||
const edit = await posts.diffs.restore(data.pid, data.since, socket.uid, websockets.reqFromSocket(socket));
|
||||
const edit = await posts.diffs.restore(data.pid, data.since, socket.uid, apiHelpers.buildReqObject(socket));
|
||||
websockets.in('topic_' + edit.topic.tid).emit('event:post_edited', edit);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user