u
This commit is contained in:
1 parent
5ca04f85ca
commit
d9c49b34db
17 files changed
+452
-175
No files matched your search
@@ -143,16 +143,17 @@ func (q *Queries) ListSpaceUsers(ctx context.Context, spaceID int64) ([]ListSpac
|
||||
const updateSpaceUserRole = `-- name: UpdateSpaceUserRole :exec
|
||||
UPDATE space_user
|
||||
SET role = $1
|
||||
WHERE user_id = $2
|
||||
WHERE user_id = $2 AND space_id = $3
|
||||
`
|
||||
|
||||
type UpdateSpaceUserRoleParams struct {
|
||||
Role int32
|
||||
UserID int64
|
||||
Role int32
|
||||
UserID int64
|
||||
SpaceID int64
|
||||
}
|
||||
|
||||
// 修改角色
|
||||
func (q *Queries) UpdateSpaceUserRole(ctx context.Context, arg UpdateSpaceUserRoleParams) error {
|
||||
_, err := q.db.Exec(ctx, updateSpaceUserRole, arg.Role, arg.UserID)
|
||||
_, err := q.db.Exec(ctx, updateSpaceUserRole, arg.Role, arg.UserID, arg.SpaceID)
|
||||
return err
|
||||
}
|
||||
Reference in new issue
Block a user