aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/AttributeResource.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/resource/AttributeResource.java b/src/main/java/org/traccar/api/resource/AttributeResource.java
index ab7e43add..43d8a7ccd 100644
--- a/src/main/java/org/traccar/api/resource/AttributeResource.java
+++ b/src/main/java/org/traccar/api/resource/AttributeResource.java
@@ -16,6 +16,7 @@
*/
package org.traccar.api.resource;
+import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.POST;
@@ -29,6 +30,7 @@ import javax.ws.rs.core.Response;
import org.traccar.Context;
import org.traccar.api.ExtendedObjectResource;
+import org.traccar.config.Config;
import org.traccar.model.Attribute;
import org.traccar.model.Device;
import org.traccar.model.Position;
@@ -43,6 +45,9 @@ import org.traccar.storage.query.Request;
@Consumes(MediaType.APPLICATION_JSON)
public class AttributeResource extends ExtendedObjectResource<Attribute> {
+ @Inject
+ private Config config;
+
public AttributeResource() {
super(Attribute.class);
}
@@ -57,7 +62,7 @@ public class AttributeResource extends ExtendedObjectResource<Attribute> {
new Columns.All(),
new Condition.LatestPositions(deviceId)));
- Object result = new ComputedAttributesHandler(Context.getConfig(), Context.getIdentityManager(), null)
+ Object result = new ComputedAttributesHandler(config, Context.getIdentityManager(), null)
.computeAttribute(entity, position);
if (result != null) {
switch (entity.getType()) {