diff --git a/internal/services/task_service.go b/internal/services/task_service.go index 2a7828b..b3b82bb 100644 --- a/internal/services/task_service.go +++ b/internal/services/task_service.go @@ -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(