Remove PostProvider methods from Core.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / DeletePostAjaxPage.java
index 71b0016..943d6a8 100644 (file)
 
 package net.pterodactylus.sone.web.ajax;
 
-import com.google.common.base.Optional;
-
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.web.WebInterface;
 import net.pterodactylus.sone.web.page.FreenetRequest;
-import net.pterodactylus.util.json.JsonObject;
+
+import com.google.common.base.Optional;
 
 /**
  * This AJAX page deletes a post.
@@ -45,13 +44,10 @@ public class DeletePostAjaxPage extends JsonPage {
        // JSONPAGE METHODS
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
-       protected JsonObject createJsonObject(FreenetRequest request) {
+       protected JsonReturnObject createJsonObject(FreenetRequest request) {
                String postId = request.getHttpRequest().getParam("post");
-               Optional<Post> post = webInterface.getCore().getPost(postId);
+               Optional<Post> post = webInterface.getCore().getDatabase().getPost(postId);
                if (!post.isPresent()) {
                        return createErrorJsonObject("invalid-post-id");
                }