refactor(role): Comment out role name existence check in CreateRole function
Deploy Application / deploy (push) Successful in 23s Details

This commit is contained in:
Habib Fatkhul Rohman 2025-11-03 14:19:52 +07:00
parent f1a5395d68
commit bc932901f7
1 changed files with 7 additions and 7 deletions

View File

@ -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 {