Skip to content

Commit

Permalink
inline list
Browse files Browse the repository at this point in the history
  • Loading branch information
jcardus committed Jul 8, 2021
1 parent 44e9726 commit b150607
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;

Expand Down Expand Up @@ -59,9 +60,7 @@ private void checkPermission(Permission permission, boolean link) {

@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")
Expand All @@ -85,9 +84,7 @@ public Response add(List<LinkedHashMap<String, Long>> entities) throws SQLExcept

@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
Expand Down

0 comments on commit b150607

Please sign in to comment.