Mercurial > lada > lada-server
changeset 90:7b084beab4a7
Get Success-Code directly from repository when initialising the response.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Fri, 07 Jun 2013 15:20:51 +0200 |
parents | 23ac762c46dc |
children | 5471557eaf76 |
files | src/main/java/de/intevation/lada/rest/LProbeService.java |
diffstat | 1 files changed, 1 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/rest/LProbeService.java Fri Jun 07 15:20:11 2013 +0200 +++ b/src/main/java/de/intevation/lada/rest/LProbeService.java Fri Jun 07 15:20:51 2013 +0200 @@ -51,12 +51,8 @@ @Path("/{id}") @Produces("text/json") public Response findById(@PathParam("id") String id) { - boolean success = true; LProbe item = repository.findById(LProbe.class, id); - if (item == null) { - success = false; - } - Response response = new Response(success, repository.getGeneralError(), item); + Response response = new Response(repository.getSuccess(), repository.getGeneralError(), item); response.setWarnings(repository.getWarnings()); response.setErrors(repository.getErrors()); return response;