Return new posts and replies with status.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / UnlikeAjaxPage.java
index ecacf98..fb0445b 100644 (file)
@@ -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();
        }
 
 }