fix(notification): ensure BuildNotificationList returns an empty slice instead of nil

This commit is contained in:
mlogclub
2026-04-28 23:09:50 +08:00
parent 28d1cfc160
commit bcd2c603f4
2 changed files with 18 additions and 3 deletions
@@ -25,9 +25,6 @@ func BuildNotification(item *models.Notification) *response.NotificationResponse
}
func BuildNotificationList(list []models.Notification) []response.NotificationResponse {
if len(list) == 0 {
return nil
}
results := make([]response.NotificationResponse, 0, len(list))
for i := range list {
if item := BuildNotification(&list[i]); item != nil {