aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/GeofenceResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/GeofenceResource.java')
-rw-r--r--src/org/traccar/api/resource/GeofenceResource.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/GeofenceResource.java b/src/org/traccar/api/resource/GeofenceResource.java
index 341180cf8..47f889e9c 100644
--- a/src/org/traccar/api/resource/GeofenceResource.java
+++ b/src/org/traccar/api/resource/GeofenceResource.java
@@ -19,6 +19,7 @@ import org.traccar.Context;
import org.traccar.api.BaseResource;
import org.traccar.database.GeofenceManager;
import org.traccar.model.Geofence;
+import org.traccar.model.User;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -85,7 +86,7 @@ public class GeofenceResource extends BaseResource {
public Response add(Geofence entity) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
Context.getGeofenceManager().addItem(entity);
- linkNewEntity(entity);
+ Context.getDataManager().linkObject(User.class, getUserId(), entity.getClass(), entity.getId(), true);
Context.getGeofenceManager().refreshUserItems();
return Response.ok(entity).build();
}