fix: send companyId as a string in backend property filters
The services-system and services-counter property maps are String-valued; a numeric companyId failed the cast there and the scoped lists came back empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
8f80f52c04
commit
bb39e6b805
6 files changed
+11
-11
No files matched your search
+1
-1
@@ -64,7 +64,7 @@ public class AdminEventLeadService {
|
||||
Map<String, Object> property = new LinkedHashMap<>();
|
||||
property.put("name", "");
|
||||
property.put("enabled", "Y");
|
||||
property.put("companyId", scope.scope(caller(), companyId));
|
||||
property.put("companyId", java.util.Objects.toString(scope.scope(caller(), companyId), null)); // backend property maps are String-valued
|
||||
Map<String, Object> request = Map.of("property", property,
|
||||
"pageableRest", Map.of("number", 0, "size", EVENT_PAGE, "sorts", List.of(Map.of("direction", "DESC", "property", "dateStart"))));
|
||||
AdminEventService.EventPage p = restTemplateUtil.postForEntity(
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ public class AdminEventService {
|
||||
|
||||
public Map<String, Object> list(String q, String enabled, int page, int size, String sortBy, String sortDir, Long companyId) {
|
||||
Map<String, Object> property = new LinkedHashMap<>();
|
||||
property.put("companyId", scope.scope(caller(), companyId));
|
||||
property.put("companyId", java.util.Objects.toString(scope.scope(caller(), companyId), null)); // backend property maps are String-valued
|
||||
property.put("name", q == null ? "" : q.trim());
|
||||
property.put("enabled", "Y".equals(enabled) || "N".equals(enabled) ? enabled : "");
|
||||
Map<String, Object> sort = Map.of("direction", "desc".equalsIgnoreCase(sortDir) ? "DESC" : "ASC",
|
||||
@@ -114,7 +114,7 @@ public class AdminEventService {
|
||||
public List<Map<String, Object>> salespersonOptions(Long companyId) {
|
||||
Long company = scope.scope(caller(), companyId);
|
||||
if (company == null) return List.of();
|
||||
Map<String, Object> request = Map.of("property", Map.of("type", "A", "companyId", company),
|
||||
Map<String, Object> request = Map.of("property", Map.of("type", "A", "companyId", String.valueOf(company)),
|
||||
"pageableRest", Map.of("number", 0, "size", 10000, "sorts", List.of(Map.of("direction", "ASC", "property", "id"))));
|
||||
Map<String, Object> body = restTemplateUtil.postForEntity(
|
||||
url(RestApiSystemServiceConstants.API_REST_SYSTEM_USER_FIND_BY_PROPERTY_AND_PAGEABLE), MAP, request).getBody();
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class AdminUserService {
|
||||
Long company = scope.scope(caller(), companyId);
|
||||
Map<String, Object> property = new HashMap<>();
|
||||
property.put("type", "A");
|
||||
if (company != null) property.put("companyId", company);
|
||||
if (company != null) property.put("companyId", String.valueOf(company)); // backend property maps are String-valued
|
||||
Map<String, Object> request = Map.of("property", property,
|
||||
"pageableRest", Map.of("number", 0, "size", 10000, "sorts", List.of(Map.of("direction", "ASC", "property", "id"))));
|
||||
ResponseEntity<Map<String, Object>> ent = restTemplateUtil.postForEntity(
|
||||
|
||||
Reference in new issue
Block a user