Merge pull request #341 from charithag/master

Fix issue in get devices with since parameter.
revert-70aa11f8
Charitha Goonetilleke 8 years ago committed by GitHub
commit 1daedfbbc4

@ -51,6 +51,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -128,7 +129,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
request.setSince(sinceDate); request.setSince(sinceDate);
result = dms.getAllDevices(request); result = dms.getAllDevices(request);
if (result == null || result.getData() == null || result.getData().size() <= 0) { if (result == null || result.getData() == null || result.getData().size() <= 0) {
return Response.status(Response.Status.OK).entity(new JsonArray()).build(); devices.setList(new ArrayList<Device>());
devices.setCount(0);
return Response.status(Response.Status.OK).entity(devices).build();
} }
} else { } else {
result = dms.getAllDevices(request); result = dms.getAllDevices(request);

Loading…
Cancel
Save