Skip to content

Commit

Permalink
Fix attributes test (fix traccar#4956)
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Oct 7, 2022
1 parent ab9ff21 commit dfaef4e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/traccar/api/resource/AttributeResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import javax.ws.rs.core.Response;

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;
Expand All @@ -45,7 +44,7 @@
public class AttributeResource extends ExtendedObjectResource<Attribute> {

@Inject
private Config config;
private ComputedAttributesHandler computedAttributesHandler;

public AttributeResource() {
super(Attribute.class);
Expand All @@ -61,7 +60,7 @@ public Response test(@QueryParam("deviceId") long deviceId, Attribute entity) th
new Columns.All(),
new Condition.LatestPositions(deviceId)));

Object result = new ComputedAttributesHandler(config, null).computeAttribute(entity, position);
Object result = computedAttributesHandler.computeAttribute(entity, position);
if (result != null) {
switch (entity.getType()) {
case "number":
Expand Down

0 comments on commit dfaef4e

Please sign in to comment.