mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
496 B
Go
28 lines
496 B
Go
//
|
|
// del.go
|
|
// Copyright (C) 2025 veypi <i@veypi.com>
|
|
// 2025-05-06 15:24
|
|
// Distributed under terms of the MIT license.
|
|
//
|
|
|
|
package role
|
|
|
|
import (
|
|
"oa/cfg"
|
|
"oa/models"
|
|
|
|
"github.com/veypi/OneBD/rest"
|
|
)
|
|
|
|
var _ = Router.Delete("/:id", userRoleDelete)
|
|
|
|
func userRoleDelete(x *rest.X) (any, error) {
|
|
id := x.Params.Get("id")
|
|
if id == "" {
|
|
return nil, rest.ErrArgInvalid.WithArgs("id")
|
|
}
|
|
data := &models.UserRole{}
|
|
err := cfg.DB().Where("id = ?", id).Delete(data).Error
|
|
return data, err
|
|
}
|