🐛 Fix notification push issue

This commit is contained in:
2024-05-13 22:31:19 +08:00
parent 07dbdd80ec
commit 0e89e325d4
2 changed files with 5 additions and 6 deletions

View File

@ -2,7 +2,6 @@ package services
import (
"context"
jsoniter "github.com/json-iterator/go"
"reflect"
"firebase.google.com/go/messaging"
@ -58,11 +57,10 @@ func NewNotification(notification models.Notification) error {
}
func PushNotification(notification models.Notification) error {
raw, _ := jsoniter.Marshal(notification)
for conn := range wsConn[notification.RecipientID] {
_ = conn.WriteMessage(1, models.UnifiedCommand{
Action: "notifications.new",
Payload: raw,
Payload: notification,
}.Marshal())
}