merge-requests/7/head
harshanl 8 years ago
commit 54112a3f3d

@ -122,7 +122,7 @@ public class ActivityProviderServiceImpl implements ActivityInfoProviderService
int count = dmService.getActivityCountUpdatedAfter(timestamp); int count = dmService.getActivityCountUpdatedAfter(timestamp);
activityList.setCount(count); activityList.setCount(count);
if (activities == null || activities.size() == 0) { if (activities == null || activities.size() == 0) {
if (isIfModifiedSinceSet || isSinceSet) { if (isIfModifiedSinceSet) {
return Response.notModified().build(); return Response.notModified().build();
} }
} }

@ -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