aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/AttributeResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/AttributeResource.java')
-rw-r--r--src/org/traccar/api/resource/AttributeResource.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/AttributeResource.java b/src/org/traccar/api/resource/AttributeResource.java
index c67d9cafe..2f731e3a7 100644
--- a/src/org/traccar/api/resource/AttributeResource.java
+++ b/src/org/traccar/api/resource/AttributeResource.java
@@ -19,6 +19,7 @@ package org.traccar.api.resource;
import java.sql.SQLException;
import java.util.Collection;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.Set;
import javax.ws.rs.Consumes;
@@ -86,7 +87,10 @@ public class AttributeResource extends BaseResource {
private Response add(Attribute entity) throws SQLException {
Context.getAttributesManager().addItem(entity);
- Context.getDataManager().linkAttribute(getUserId(), entity.getId());
+ LinkedHashMap<String, Long> link = new LinkedHashMap<>();
+ link.put("userId", getUserId());
+ link.put("attributeId", entity.getId());
+ Context.getDataManager().linkObject(link, true);
Context.getAttributesManager().refreshUserItems();
return Response.ok(entity).build();
}