refactor(role): Comment out role name existence check in CreateRole function
Deploy Application / deploy (push) Successful in 23s
Details
Deploy Application / deploy (push) Successful in 23s
Details
This commit is contained in:
parent
f1a5395d68
commit
bc932901f7
|
|
@ -212,13 +212,13 @@ func (r *roleService) AssignRolesToUser(ctx context.Context, userId string, role
|
|||
|
||||
// CreateRole implements RoleService.
|
||||
func (r *roleService) CreateRole(ctx context.Context, req dto.RoleCreateRequest) (dto.RoleResponse, error) {
|
||||
_, exists, err := r.roleRepo.CheckRoleName(ctx, r.db, req.Name)
|
||||
if err != nil && err != gorm.ErrRecordNotFound {
|
||||
return dto.RoleResponse{}, err
|
||||
}
|
||||
if exists {
|
||||
return dto.RoleResponse{}, dto.ErrRoleAlreadyExists
|
||||
}
|
||||
// _, exists, err := r.roleRepo.CheckRoleName(ctx, r.db, req.Name)
|
||||
// if err != nil && err != gorm.ErrRecordNotFound {
|
||||
// return dto.RoleResponse{}, err
|
||||
// }
|
||||
// if exists {
|
||||
// return dto.RoleResponse{}, dto.ErrRoleAlreadyExists
|
||||
// }
|
||||
|
||||
clientUUID, err := uuid.Parse(req.ClientID)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue