X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FGetLikesAjaxPage.java;h=f4bf648f6c968173ce1c15ef1b5ae69f94106cf1;hb=40e4cfe73a346f7dc9d46aedbeccd6a38798f175;hp=dea635cbb5523ab1686878fea53c2374bf48c418;hpb=cb7aebca2a351028dd4fdd00dcd637c6aafac79b;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java index dea635c..f4bf648 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetLikesAjaxPage.java @@ -64,18 +64,18 @@ public class GetLikesAjaxPage extends JsonPage { return createErrorJsonObject("invalid-" + type + "-id"); } if ("post".equals(type)) { - Optional post = webInterface.getCore().getPost(id); + Optional post = webInterface.getCore().getDatabase().getPost(id); if (!post.isPresent()) { return createErrorJsonObject("invalid-post-id"); } - Set sones = webInterface.getCore().getLikes(post.get()); + Set sones = post.get().getLikes(); return createSuccessJsonObject().put("likes", sones.size()).put("sones", getSones(sones)); } else if ("reply".equals(type)) { - Optional reply = webInterface.getCore().getPostReply(id); + Optional reply = webInterface.getCore().getDatabase().getPostReply(id); if (!reply.isPresent()) { return createErrorJsonObject("invalid-reply-id"); } - Set sones = webInterface.getCore().getLikes(reply.get()); + Set sones = reply.get().getLikes(); return createSuccessJsonObject().put("likes", sones.size()).put("sones", getSones(sones)); } return createErrorJsonObject("invalid-type");