From 4d6bdcecee6a9c8b995d176aa714e9eacae82d87 Mon Sep 17 00:00:00 2001 From: VasylyshynDmytro Date: Fri, 13 Dec 2024 21:44:07 +0200 Subject: [PATCH] Fix for sonarqube --- service/src/main/java/greencity/service/PlaceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/greencity/service/PlaceServiceImpl.java b/service/src/main/java/greencity/service/PlaceServiceImpl.java index 854a17a14..97da1b946 100644 --- a/service/src/main/java/greencity/service/PlaceServiceImpl.java +++ b/service/src/main/java/greencity/service/PlaceServiceImpl.java @@ -629,7 +629,7 @@ private PageableDto getSearchPlacesDtoPageableDto(Page p public UpdatePlaceStatusWithUserEmailDto updatePlaceStatus(UpdatePlaceStatusWithUserEmailDto dto) { Place place = placeRepo.findByNameIgnoreCase(dto.getPlaceName()) .orElseThrow(() -> new NotFoundException(ErrorMessage.PLACE_NOT_FOUND_BY_NAME + dto.getPlaceName())); - userRepo.findByEmail(dto.getEmail()) + User user = userRepo.findByEmail(dto.getEmail()) .orElseThrow(() -> new NotFoundException(ErrorMessage.USER_NOT_FOUND_BY_EMAIL + dto.getEmail())); place.setStatus(dto.getNewStatus()); placeRepo.save(place);