Updated resources responces support
This commit is contained in:
parent
7313c1f8fc
commit
c128f13eb7
|
@ -87,6 +87,10 @@ public class EPASContractsResource {
|
||||||
if (email.isPresent()) {
|
if (email.isPresent()) {
|
||||||
log.info("REST request to get ePAS Contracts by Person email: {}", email.get());
|
log.info("REST request to get ePAS Contracts by Person email: {}", email.get());
|
||||||
epasContractsList = epasContractsService.getByPersonEmail(email.get());
|
epasContractsList = epasContractsService.getByPersonEmail(email.get());
|
||||||
|
} else {
|
||||||
|
return ResponseUtil.wrapOrNotFound(Optional.of(epasContractsList), HeaderUtil.createFailureAlert(applicationName,false,
|
||||||
|
"","","Invalid parameter in call"));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import io.github.jhipster.web.util.HeaderUtil;
|
||||||
import io.github.jhipster.web.util.ResponseUtil;
|
import io.github.jhipster.web.util.ResponseUtil;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASLeaves;
|
import it.cnr.isti.epasmed.epas.model.EPASLeaves;
|
||||||
import it.cnr.isti.epasmed.epas.service.EPASLeavesService;
|
import it.cnr.isti.epasmed.epas.service.EPASLeavesService;
|
||||||
|
@ -58,6 +59,10 @@ public class EPASLeavesResource {
|
||||||
if (email.isPresent()) {
|
if (email.isPresent()) {
|
||||||
log.info("REST request to get ePAS Leaves by Person email: {}", email.get());
|
log.info("REST request to get ePAS Leaves by Person email: {}", email.get());
|
||||||
epasLeavesList = epasLeavesService.getLeavesByPersonEmail(email.get(), year);
|
epasLeavesList = epasLeavesService.getLeavesByPersonEmail(email.get(), year);
|
||||||
|
} else {
|
||||||
|
return ResponseUtil.wrapOrNotFound(Optional.of(epasLeavesList), HeaderUtil.createFailureAlert(applicationName,false,
|
||||||
|
"","","Invalid parameter in call"));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue