bug fixes (#918)

* bug fixes

* fix for backward compatibility

* fix init

* cleanup

* possible fix

* optimize permission check

* Revert "possible fix"

This reverts commit 003f1bbb2aa368aade6702e6019922b7f4871a39.
This commit is contained in:
UUBulb
2024-12-26 23:38:40 +08:00
committed by GitHub
parent b876909a8a
commit 85818c2630
5 changed files with 16 additions and 10 deletions

View File

@@ -168,7 +168,7 @@ func updateNotificationGroup(c *gin.Context) (any, error) {
ngf.Notifications = slices.Compact(ngf.Notifications)
var count int64
if err := singleton.DB.Model(&model.Server{}).Where("id in (?)", ngf.Notifications).Count(&count).Error; err != nil {
if err := singleton.DB.Model(&model.Notification{}).Where("id in (?)", ngf.Notifications).Count(&count).Error; err != nil {
return nil, newGormError("%v", err)
}
if count != int64(len(ngf.Notifications)) {