From 7b21a1fde5cf708b2f4cde79114729bc1f822c9a Mon Sep 17 00:00:00 2001 From: dashevchenko Date: Mon, 2 Dec 2024 18:02:17 +0200 Subject: [PATCH] adding active-filter if not null --- .../main/java/org/thingsboard/rest/client/RestClient.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java index 0f1d1a802a..b39f7b32d1 100644 --- a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java +++ b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java @@ -1359,11 +1359,14 @@ public class RestClient implements Closeable { public PageData getTenantDeviceInfos(String type, Boolean active, DeviceProfileId deviceProfileId, PageLink pageLink) { Map params = new HashMap<>(); params.put("type", type); - params.put("active", active != null ? active.toString() : null); params.put("deviceProfileId", deviceProfileId != null ? deviceProfileId.toString() : null); + if (active != null) { + params.put("active", active.toString()); + } addPageLinkToParam(params, pageLink); return restTemplate.exchange( - baseURL + "/api/tenant/deviceInfos?type={type}&active={active}&deviceProfileId={deviceProfileId}&" + getUrlParams(pageLink), + baseURL + "/api/tenant/deviceInfos?type={type}&deviceProfileId={deviceProfileId}&" + + (active != null ? "active={active}&" : "") + getUrlParams(pageLink), HttpMethod.GET, HttpEntity.EMPTY, new ParameterizedTypeReference>() { }, params).getBody();