diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java b/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java index a010434b4..0cfaebc1b 100644 --- a/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java +++ b/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java @@ -90,6 +90,12 @@ public class ResponseUtil { return Response.ok(json, MediaType.APPLICATION_JSON).build(); } + public static Response toResponse(JsonObject response) { + response.addProperty(MSG, StringHelper.DASH); + String json = new Gson().toJson(response); + return Response.ok(json, MediaType.APPLICATION_JSON).build(); + } + public static Response toResponse(String member, List list, Function toJson) { return toResponse(member, list.stream().map(toJson).collect(Collectors.toList())); }