aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
authorjcardus <asklocation.net@gmail.com>2021-07-08 03:04:17 +0100
committerjcardus <asklocation.net@gmail.com>2021-07-08 03:04:17 +0100
commitb1506079ac9ed971d9c658043f83fa5886564f3a (patch)
tree717d7da9624f29d82fd207106c232f10c761f8be /src/main/java/org/traccar/api
parent44e9726886ad14c1b61e4dedb0acc97e7d76b46f (diff)
downloadtrackermap-server-b1506079ac9ed971d9c658043f83fa5886564f3a.tar.gz
trackermap-server-b1506079ac9ed971d9c658043f83fa5886564f3a.tar.bz2
trackermap-server-b1506079ac9ed971d9c658043f83fa5886564f3a.zip
inline list
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/PermissionsResource.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/api/resource/PermissionsResource.java b/src/main/java/org/traccar/api/resource/PermissionsResource.java
index 7502e9134..0acca5273 100644
--- a/src/main/java/org/traccar/api/resource/PermissionsResource.java
+++ b/src/main/java/org/traccar/api/resource/PermissionsResource.java
@@ -18,6 +18,7 @@ package org.traccar.api.resource;
import java.sql.SQLException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
@@ -59,9 +60,7 @@ public class PermissionsResource extends BaseResource {
@POST
public Response add(LinkedHashMap<String, Long> entity) throws SQLException, ClassNotFoundException {
- List<LinkedHashMap<String, Long>> list = new ArrayList<>();
- list.add(entity);
- return add(list);
+ return add(Collections.singletonList(entity));
}
@Path("bulk")
@@ -85,9 +84,7 @@ public class PermissionsResource extends BaseResource {
@DELETE
public Response remove(LinkedHashMap<String, Long> entity) throws SQLException, ClassNotFoundException {
- List<LinkedHashMap<String, Long>> list = new ArrayList<>();
- list.add(entity);
- return remove(list);
+ return remove(Collections.singletonList(entity));
}
@DELETE