Fix api empty list issue

rm-10378
Pramila Niroshan 1 year ago
parent df2943ed1e
commit bc9121e3e6

@ -46,11 +46,10 @@ public class DeviceStatusFilterServiceImpl implements DeviceStatusFilterService
try {
DeviceStatusManagementService deviceManagementProviderService = DeviceMgtAPIUtils.getDeviceStatusManagmentService();
result = deviceManagementProviderService.getDeviceStatusFilters(deviceType, tenantId);
if (result != null && !result.isEmpty()) {
if (result != null) {
return Response.status(Response.Status.OK).entity(result).build();
} else {
return Response.status(Response.Status.NO_CONTENT).build();
}
return Response.status(Response.Status.NO_CONTENT).entity(false).build();
} catch (MetadataManagementException e) {
String msg = "Error occurred while getting device status filter of the tenant.";
log.error(msg, e);

Loading…
Cancel
Save