X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FLikeAjaxPage.java;h=17438d4af3386cbe5c94cc00dbec037a8a520ebd;hb=bd56e01d9efa9b54074dad9b698e98e7dc2be46d;hp=258eb7facc2f4f0e40159dfe0f1d33c21b09e9d2;hpb=dc3d0d58fd47e520c723aa7d258c2f7ae09e1ee7;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java index 258eb7f..17438d4 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/LikeAjaxPage.java @@ -55,12 +55,14 @@ public class LikeAjaxPage extends JsonPage { } if ("post".equals(type)) { currentSone.addLikedPostId(id); + webInterface.getCore().saveSone(currentSone); } else if ("reply".equals(type)) { currentSone.addLikedReplyId(id); + webInterface.getCore().saveSone(currentSone); } else { return createErrorJsonObject("invalid-type"); } - return new JsonObject().put("success", true); + return createSuccessJsonObject(); } }