diff --git a/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/controller/BuscadorForwarderController.java b/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/controller/BuscadorForwarderController.java index 1c04ad3..de66ae2 100644 --- a/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/controller/BuscadorForwarderController.java +++ b/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/controller/BuscadorForwarderController.java @@ -15,7 +15,7 @@ * todo aƱadir loans */ @RestController -@Profile("dev") +@Profile("prod") public class BuscadorForwarderController { private final BuscadorClient buscadorClient; diff --git a/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/service/LoanService.java b/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/service/LoanService.java index 7c408ee..2bf495b 100644 --- a/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/service/LoanService.java +++ b/src/main/java/net/unir/missi/desarrollowebfullstack/bookabook/operador/service/LoanService.java @@ -82,14 +82,18 @@ public LoanResponse createLoan(LoanRequest request) { throw new EntityNotFoundException("Book id " + loan.getBookId() + " does not exist.", null); } + Logger.getGlobal().warning("hasta aki existe book"); // If loan referencing non-existing clients throw 404 if(! isExistingClient(loan.getClientId().toString())) { throw new EntityNotFoundException("Client id " + loan.getClientId() + " does not exist.", null); } + Logger.getGlobal().warning("hasta aki existe client"); + // Implicit else: valid loan is saved in the DB Loan createdLoan = loanRepository.save(loan); + Logger.getGlobal().warning("hasta aki ya se ha guardao"); return this.loanToLoanResponseConverter.convert(createdLoan); }