From c128f13eb700b7737959861d0ae301fb85a3cbf2 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 3 Dec 2021 19:10:43 +0100 Subject: [PATCH] Updated resources responces support --- .../isti/epasmed/web/rest/epas/EPASContractsResource.java | 4 ++++ .../cnr/isti/epasmed/web/rest/epas/EPASLeavesResource.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASContractsResource.java b/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASContractsResource.java index 9d91ad4..377d0bf 100644 --- a/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASContractsResource.java +++ b/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASContractsResource.java @@ -87,6 +87,10 @@ public class EPASContractsResource { if (email.isPresent()) { log.info("REST request to get ePAS Contracts by Person email: {}", email.get()); epasContractsList = epasContractsService.getByPersonEmail(email.get()); + } else { + return ResponseUtil.wrapOrNotFound(Optional.of(epasContractsList), HeaderUtil.createFailureAlert(applicationName,false, + "","","Invalid parameter in call")); + } } } diff --git a/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASLeavesResource.java b/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASLeavesResource.java index 0604632..a838590 100644 --- a/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASLeavesResource.java +++ b/src/main/java/it/cnr/isti/epasmed/web/rest/epas/EPASLeavesResource.java @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import io.github.jhipster.web.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import it.cnr.isti.epasmed.epas.model.EPASLeaves; import it.cnr.isti.epasmed.epas.service.EPASLeavesService; @@ -58,6 +59,10 @@ public class EPASLeavesResource { if (email.isPresent()) { log.info("REST request to get ePAS Leaves by Person email: {}", email.get()); epasLeavesList = epasLeavesService.getLeavesByPersonEmail(email.get(), year); + } else { + return ResponseUtil.wrapOrNotFound(Optional.of(epasLeavesList), HeaderUtil.createFailureAlert(applicationName,false, + "","","Invalid parameter in call")); + } } }