refactored user,role and region code
This commit is contained in:
@@ -99,15 +99,13 @@ public class RoleDao {
|
||||
}
|
||||
public RoleResponseBean getRoleById(Long id) {
|
||||
log.info("Fetching role with ID: {}", id);
|
||||
RoleEntity roleEntity = roleRepository.findById(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.ROLE_NOT_FOUND)));
|
||||
RoleEntity roleEntity = validateRole(id);
|
||||
log.info("Role found: {}", roleEntity);
|
||||
return convertRoleEntityToRoleResponse(roleEntity);
|
||||
}
|
||||
public void deleteById(Long id) {
|
||||
log.info("Deleting role with ID: {}", id);
|
||||
roleRepository.findById(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.ROLE_NOT_FOUND)));
|
||||
validateRole(id);
|
||||
roleRepository.deleteById(id);
|
||||
log.info("Role deleted with ID: {}", id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user