refactored user,role and region code
This commit is contained in:
@@ -111,14 +111,12 @@ public class RegionDao {
|
||||
}
|
||||
public RegionResponseBean getRegionById(Long id) {
|
||||
log.info("Fetching region with ID: {}", id);
|
||||
RegionEntity regionEntity = regionRepository.findById(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.REGION_NOT_FOUND_MSG)));
|
||||
RegionEntity regionEntity = validateRegion(id);
|
||||
return convertRegionEntityToRegionResponse(regionEntity);
|
||||
}
|
||||
public void deleteById(Long id) {
|
||||
log.info("Deleting region with ID: {}", id);
|
||||
regionRepository.findById(id)
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND, Translator.toLocale(GepafinConstant.REGION_NOT_FOUND_MSG)));
|
||||
validateRegion(id);
|
||||
regionRepository.deleteById(id);
|
||||
log.info("Region deleted with ID: {}", id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user