Updated resources responces support

This commit is contained in:
Giancarlo Panichi 2021-12-03 19:10:43 +01:00
parent 7313c1f8fc
commit c128f13eb7
2 changed files with 9 additions and 0 deletions

View File

@ -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"));
}
}
}

View File

@ -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"));
}
}
}