Fix: completer gets email but not push notification
- Push notification: sent to all users EXCEPT completer - Email: sent to ALL users INCLUDING completer 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -519,14 +519,12 @@ func (s *TaskService) sendTaskCompletedNotification(task *models.Task, completio
|
||||
"completion_id": completion.ID,
|
||||
}
|
||||
|
||||
// Notify all users except the one who completed the task
|
||||
// Notify all users
|
||||
for _, user := range users {
|
||||
if user.ID == completion.CompletedByID {
|
||||
continue // Don't notify the person who completed it
|
||||
}
|
||||
isCompleter := user.ID == completion.CompletedByID
|
||||
|
||||
// Send push notification
|
||||
if s.notificationService != nil {
|
||||
// Send push notification (to everyone EXCEPT the person who completed it)
|
||||
if !isCompleter && s.notificationService != nil {
|
||||
go func(userID uint) {
|
||||
ctx := context.Background()
|
||||
if err := s.notificationService.CreateAndSendNotification(
|
||||
@@ -542,7 +540,7 @@ func (s *TaskService) sendTaskCompletedNotification(task *models.Task, completio
|
||||
}(user.ID)
|
||||
}
|
||||
|
||||
// Send email notification
|
||||
// Send email notification (to everyone INCLUDING the person who completed it)
|
||||
if s.emailService != nil && user.Email != "" {
|
||||
go func(u models.User) {
|
||||
if err := s.emailService.SendTaskCompletedEmail(
|
||||
|
||||
Reference in New Issue
Block a user