🐛 Fix bugs in updating notification preferences

This commit is contained in:
LittleSheep 2024-09-17 15:56:41 +08:00
parent f287e295e5
commit 5203234c4a

View File

@ -28,6 +28,10 @@ func UpdateNotificationPreference(account models.Account, config map[string]bool
lo.MapValues(config, func(v bool, k string) any { return v }), lo.MapValues(config, func(v bool, k string) any { return v }),
), ),
} }
} else {
notification.Config = datatypes.JSONMap(
lo.MapValues(config, func(v bool, k string) any { return v }),
)
} }
err = database.C.Save(&notification).Error err = database.C.Save(&notification).Error