fix(teams): send @username in notifications

This commit is contained in:
SabreCat 2022-08-22 11:39:53 -05:00
parent 89c07529ea
commit 631d7111a5
3 changed files with 5 additions and 5 deletions

View file

@ -201,7 +201,7 @@
"yourTaskHasBeenApproved": "Your task <span class=\"notification-green notification-bold\"><%- taskText %></span> has been approved.",
"thisTaskApproved": "This task was approved",
"taskClaimed": "<%- userName %> has claimed the task <span class=\"notification-bold\"><%- taskText %></span>.",
"taskNeedsWork": "<span class=\"notification-bold\"><%- taskText %></span> was unchecked by <span class=\"notification-bold\"><%- managerName %></span>. Your rewards for completing the task were reverted.",
"taskNeedsWork": "<span class=\"notification-bold\"><%- taskText %></span> was unchecked by <span class=\"notification-bold\">@<%- managerName %></span>. Your rewards for completing the task were reverted.",
"userHasRequestedTaskApproval": "<span class=\"notification-bold\"><%- user %></span> requests approval for <span class=\"notification-bold\"><%- taskName %></span>",
"approve": "Approve",
"approveTask": "Approve Task",

View file

@ -371,7 +371,7 @@ api.taskNeedsWork = {
await scoreTasks(assignedUser, [{ id: task._id, direction: 'down' }], req, res);
assignedUser.addNotification('GROUP_TASK_NEEDS_WORK', {
message: res.t('taskNeedsWork', { taskText: task.text, managerName: user.profile.name }, assignedUser.preferences.language),
message: res.t('taskNeedsWork', { taskText: task.text, managerName: user.auth.local.username }, assignedUser.preferences.language),
task: {
id: task._id,
text: task.text,
@ -382,7 +382,7 @@ api.taskNeedsWork = {
},
manager: {
id: user._id,
name: user.profile.name,
name: user.auth.local.username,
},
});
await Promise.all([assignedUser.save(), task.save()]);

View file

@ -452,7 +452,7 @@ async function scoreTask (user, task, direction, req, res) {
direction,
}, req, res.analytics);
rollbackUser.addNotification('GROUP_TASK_NEEDS_WORK', {
message: res.t('taskNeedsWork', { taskText: task.text, managerName: user.profile.name }, rollbackUser.preferences.language),
message: res.t('taskNeedsWork', { taskText: task.text, managerName: user.auth.local.username }, rollbackUser.preferences.language),
task: {
id: task._id,
text: task.text,
@ -463,7 +463,7 @@ async function scoreTask (user, task, direction, req, res) {
},
manager: {
id: user._id,
name: user.profile.name,
name: user.auth.local.username,
},
});
await rollbackUser.save();