aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/DeviceResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/DeviceResource.java')
-rw-r--r--src/org/traccar/api/resource/DeviceResource.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java
index 0d6e4f09c..a6b3ef964 100644
--- a/src/org/traccar/api/resource/DeviceResource.java
+++ b/src/org/traccar/api/resource/DeviceResource.java
@@ -19,6 +19,7 @@ import org.traccar.Context;
import org.traccar.api.BaseResource;
import org.traccar.model.Device;
import org.traccar.model.DeviceTotalDistance;
+import org.traccar.model.User;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -77,7 +78,7 @@ public class DeviceResource extends BaseResource {
Context.getPermissionsManager().checkDeviceReadonly(getUserId());
Context.getPermissionsManager().checkDeviceLimit(getUserId());
Context.getDeviceManager().addDevice(entity);
- linkNewEntity(entity);
+ Context.getDataManager().linkObject(User.class, getUserId(), entity.getClass(), entity.getId(), true);
Context.getPermissionsManager().refreshPermissions();
Context.getPermissionsManager().refreshAllExtendedPermissions();
return Response.ok(entity).build();