Skip to content

Commit 7a099b2

Browse files
authored
Merge pull request #4046 from Northeastern-Electric-Racing/#3945-remove-slack-personal-notif
#3945 don't send slack notif when user is assignee
2 parents 18bc554 + 368ecb7 commit 7a099b2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/backend/src/services/tasks.services.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ export default class TasksService {
122122

123123
const newTask = taskTransformer(createdTask);
124124

125-
await sendSlackTaskAssignedNotificationToUsers(newTask, assignees, organization.organizationId);
125+
const nonSelfAssigneeIds = assignees.filter((id) => id !== createdBy.userId);
126+
await sendSlackTaskAssignedNotificationToUsers(newTask, nonSelfAssigneeIds, organization.organizationId);
126127

127128
return newTask;
128129
}
@@ -254,7 +255,8 @@ export default class TasksService {
254255
})
255256
);
256257

257-
await sendSlackTaskAssignedNotificationToUsers(updatedTask, newAssigneeIds, organization.organizationId);
258+
const nonSelfAssigneeIds = newAssigneeIds.filter((id) => id !== user.userId);
259+
await sendSlackTaskAssignedNotificationToUsers(updatedTask, nonSelfAssigneeIds, organization.organizationId);
258260

259261
return updatedTask;
260262
}

0 commit comments

Comments
 (0)