X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FUnlikeAjaxPage.java;h=e5c933dbfaeb497276357f1d72d705bdd3f8369f;hb=8454806e48890675178c1b4b6cbe4bb9c42b68a3;hp=ecacf988c69a68c2b6836596c457940d7de2b4c2;hpb=dc3d0d58fd47e520c723aa7d258c2f7ae09e1ee7;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java index ecacf98..e5c933d 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/UnlikeAjaxPage.java @@ -36,7 +36,7 @@ public class UnlikeAjaxPage extends JsonPage { * The Sone web interface */ public UnlikeAjaxPage(WebInterface webInterface) { - super("ajax/unlike.ajax", webInterface); + super("unlike.ajax", webInterface); } /** @@ -55,12 +55,14 @@ public class UnlikeAjaxPage extends JsonPage { } if ("post".equals(type)) { currentSone.removeLikedPostId(id); + webInterface.getCore().saveSone(currentSone); } else if ("reply".equals(type)) { currentSone.removeLikedReplyId(id); + webInterface.getCore().saveSone(currentSone); } else { return createErrorJsonObject("invalid-type"); } - return new JsonObject().put("success", true); + return createSuccessJsonObject(); } }