🐛 Fix push notification to wrong person

This commit is contained in:
2024-07-21 22:52:24 +08:00
parent 6350ec1e43
commit d08b7a273d
2 changed files with 6 additions and 13 deletions

View File

@ -148,7 +148,9 @@ func PushNotificationBatch(notifications []models.Notification) {
var providers []string
var tokens []string
for _, subscriber := range subscribers {
for _, subscriber := range lo.Filter(subscribers, func(item models.NotificationSubscriber, index int) bool {
return item.AccountID == notification.AccountID
}) {
providers = append(providers, subscriber.Provider)
tokens = append(tokens, subscriber.DeviceToken)
}