Passport/pkg/internal/services/badges.go
2024-06-16 23:17:32 +08:00

16 lines
349 B
Go

package services
import (
"git.solsynth.dev/hydrogen/passport/pkg/database"
"git.solsynth.dev/hydrogen/passport/pkg/models"
)
func GrantBadge(user models.Account, badge models.Badge) error {
badge.AccountID = user.ID
return database.C.Save(badge).Error
}
func RevokeBadge(badge models.Badge) error {
return database.C.Delete(&badge).Error
}