mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
chore: eslint prefer-template
This commit is contained in:
committed by
Julian Lam
parent
4ee0f1459d
commit
707b55b6a5
@@ -70,7 +70,7 @@ async function logTopicAction(action, req, tid, title) {
|
||||
return;
|
||||
}
|
||||
await events.log({
|
||||
type: 'topic-' + action,
|
||||
type: `topic-${action}`,
|
||||
uid: req.uid,
|
||||
ip: req.ip,
|
||||
tid: tid,
|
||||
@@ -88,7 +88,7 @@ exports.postCommand = async function (caller, command, eventName, notification,
|
||||
}
|
||||
|
||||
if (!data.room_id) {
|
||||
throw new Error('[[error:invalid-room-id, ' + data.room_id + ' ]]');
|
||||
throw new Error(`[[error:invalid-room-id, ${data.room_id} ]]`);
|
||||
}
|
||||
const [exists, deleted] = await Promise.all([
|
||||
posts.exists(data.pid),
|
||||
@@ -111,7 +111,7 @@ exports.postCommand = async function (caller, command, eventName, notification,
|
||||
filter:post.bookmark
|
||||
filter:post.unbookmark
|
||||
*/
|
||||
const filteredData = await plugins.hooks.fire('filter:post.' + command, {
|
||||
const filteredData = await plugins.hooks.fire(`filter:post.${command}`, {
|
||||
data: data,
|
||||
uid: caller.uid,
|
||||
});
|
||||
@@ -121,8 +121,8 @@ exports.postCommand = async function (caller, command, eventName, notification,
|
||||
async function executeCommand(caller, command, eventName, notification, data) {
|
||||
const result = await posts[command](data.pid, caller.uid);
|
||||
if (result && eventName) {
|
||||
websockets.in('uid_' + caller.uid).emit('posts.' + command, result);
|
||||
websockets.in(data.room_id).emit('event:' + eventName, result);
|
||||
websockets.in(`uid_${caller.uid}`).emit(`posts.${command}`, result);
|
||||
websockets.in(data.room_id).emit(`event:${eventName}`, result);
|
||||
}
|
||||
if (result && command === 'upvote') {
|
||||
socketHelpers.upvote(result, notification);
|
||||
|
||||
Reference in New Issue
Block a user