// // del.go // Copyright (C) 2025 veypi // 2025-05-06 15:24 // Distributed under terms of the MIT license. // package role import ( "github.com/veypi/OneAuth/cfg" "github.com/veypi/OneAuth/models" "github.com/vyes/vigo" ) var _ = Router.Delete("/:id", userRoleDelete) func userRoleDelete(x *vigo.X) (any, error) { id := x.Params.Get("id") if id == "" { return nil, vigo.ErrArgInvalid.WithArgs("id") } data := &models.UserRole{} err := cfg.DB().Where("id = ?", id).Delete(data).Error return data, err }