chore: eslint prefer-template

This commit is contained in:
Peter Jaszkowiak
2021-02-03 23:59:08 -07:00
committed by Julian Lam
parent 4ee0f1459d
commit 707b55b6a5
357 changed files with 2425 additions and 2427 deletions

View File

@@ -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);