diff options
Diffstat (limited to 'src/org/traccar/api/resource/DriverResource.java')
-rw-r--r-- | src/org/traccar/api/resource/DriverResource.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/DriverResource.java b/src/org/traccar/api/resource/DriverResource.java index cf80bf7df..72eadb711 100644 --- a/src/org/traccar/api/resource/DriverResource.java +++ b/src/org/traccar/api/resource/DriverResource.java @@ -37,6 +37,7 @@ import org.traccar.Context; import org.traccar.api.BaseResource; import org.traccar.database.DriversManager; import org.traccar.model.Driver; +import org.traccar.model.User; @Path("drivers") @Produces(MediaType.APPLICATION_JSON) @@ -86,7 +87,7 @@ public class DriverResource extends BaseResource { public Response add(Driver entity) throws SQLException { Context.getPermissionsManager().checkReadonly(getUserId()); Context.getDriversManager().addItem(entity); - linkNewEntity(entity); + Context.getDataManager().linkObject(User.class, getUserId(), entity.getClass(), entity.getId(), true); Context.getDriversManager().refreshUserItems(); return Response.ok(entity).build(); } |