Skip to content

Commit 391ee93

Browse files
committed
mapped team id to team in slack notifications ot avoid duplicates
1 parent 0452c14 commit 391ee93

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/backend/src/services/calendar.services.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,19 +525,19 @@ export default class CalendarService {
525525
// Send popup notification
526526
await sendEventPopUp(newEvent, members, submitter, workPackageNames, organization.organizationId);
527527

528-
const teamsToNotify = new Set<Team>();
528+
const teamsToNotify = new Map<string, Team>();
529529
for (const project of projects) {
530530
for (const team of project.teams) {
531-
teamsToNotify.add(team);
531+
teamsToNotify.set(team.teamId, team);
532532
}
533533
}
534534

535535
for (const team of newEvent.teams) {
536-
teamsToNotify.add(team);
536+
teamsToNotify.set(team.teamId, team);
537537
}
538538

539539
await sendSlackEventNotifications(
540-
Array.from(teamsToNotify),
540+
Array.from(teamsToNotify.values()),
541541
createdEvent,
542542
submitter,
543543
workPackageNames,

0 commit comments

Comments
 (0)