jonahkh
2020-06-09 d149d41c6fb7801ec6c593502a5ec137b79a71ac
fix adoption service bug
1 files modified
3 ■■■■ changed files
adopt-a-pup/adoption-service/src/main/java/com/redhat/do328/adoptApup/adoptionservice/service/AdoptionService.java 3 ●●●● patch | view | raw | blame | history
adopt-a-pup/adoption-service/src/main/java/com/redhat/do328/adoptApup/adoptionservice/service/AdoptionService.java
@@ -82,7 +82,7 @@
            adoptionApplicationResponse.setMessage("This application has been denied for the following reason(s): " + message);
            adoptionApplicationResponse.setStatus(Status.DENIED);
        } else {
            final ResponseEntity<ResponseEntity> responseEntityResponseEntity = restTemplate.postForEntity(animalServiceHost + "/animals/" + application.getAnimalId() + "/setAdoptionStatus",
            final ResponseEntity responseEntityResponseEntity = restTemplate.postForEntity(animalServiceHost + "/animals/" + application.getAnimalId() + "/setAdoptionStatus",
                    new AnimalStatusChangeRequest(false), ResponseEntity.class);
            if (!responseEntityResponseEntity.getStatusCode().is2xxSuccessful()) {
                throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Something went wrong with this application, please try again later");
@@ -90,7 +90,6 @@
            // TODO send notification to user.. do this in parallel behind the scenes
            final ResponseEntity<Shelter> shelterResponse = restTemplate.getForEntity(shelterServiceHost + "/shelters/" + animal.getShelterId() + "/getShelter", Shelter.class);
            final Shelter shelter = shelterResponse.getBody();
            final String userEmail = application.getEmail();
            final String shelterEmail = shelter.getEmail();
            // TODO send email to shelter
            final String renderedTemplate = renderTemplate(application.getUsername(), animal.getAnimalName(), shelter.getShelterName(), shelterEmail, shelter.getPhoneNumber());