2024-06-02 12:45:56 +00:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
2024-10-30 16:15:25 +00:00
|
|
|
"git.solsynth.dev/hydrogen/passport/pkg/authkit/models"
|
2024-06-17 14:21:34 +00:00
|
|
|
"git.solsynth.dev/hydrogen/passport/pkg/internal/database"
|
2024-06-02 12:45:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|