diff options
-rw-r--r-- | setup/default.xml | 4 | ||||
-rw-r--r-- | src/org/traccar/api/resource/DriverResource.java | 4 | ||||
-rw-r--r-- | src/org/traccar/database/DriversManager.java | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/setup/default.xml b/setup/default.xml index 9533c3a9b..4a408bf30 100644 --- a/setup/default.xml +++ b/setup/default.xml @@ -443,7 +443,7 @@ <entry key='database.updateDriver'> UPDATE drivers SET name = :name, - uniqueId = :uniqueId + uniqueId = :uniqueId, attributes = :attributes WHERE id = :id </entry> @@ -461,7 +461,7 @@ </entry> <entry key='database.unlinkDriver'> - DELETE FROM user_attribute WHERE userId = :userId AND driverId = :driverId + DELETE FROM user_driver WHERE userId = :userId AND driverId = :driverId </entry> <entry key='database.selectGroupDrivers'> diff --git a/src/org/traccar/api/resource/DriverResource.java b/src/org/traccar/api/resource/DriverResource.java index 4ccd11182..7fe0af473 100644 --- a/src/org/traccar/api/resource/DriverResource.java +++ b/src/org/traccar/api/resource/DriverResource.java @@ -86,8 +86,8 @@ public class DriverResource extends BaseResource { public Response add(Driver entity) throws SQLException { Context.getPermissionsManager().checkReadonly(getUserId()); Context.getDriversManager().addDriver(entity); - Context.getDataManager().linkAttribute(getUserId(), entity.getId()); - Context.getAttributesManager().refreshUserAttributes(); + Context.getDataManager().linkDriver(getUserId(), entity.getId()); + Context.getDriversManager().refreshUserDrivers(); return Response.ok(entity).build(); } diff --git a/src/org/traccar/database/DriversManager.java b/src/org/traccar/database/DriversManager.java index 8df06d972..e89d59311 100644 --- a/src/org/traccar/database/DriversManager.java +++ b/src/org/traccar/database/DriversManager.java @@ -168,7 +168,7 @@ public class DriversManager { } public void removeDriver(long driverId) throws SQLException { - dataManager.removeAttribute(driverId); + dataManager.removeDriver(driverId); if (drivers.containsKey(driverId)) { String driverUniqueId = drivers.get(driverId).getUniqueId(); drivers.remove(driverId); |