* The Sone web interface
*/
public DeleteReplyAjaxPage(WebInterface webInterface) {
- super("ajax/deleteReply.ajax", webInterface);
+ super("deleteReply.ajax", webInterface);
}
//
Reply reply = webInterface.getCore().getReply(replyId);
Sone currentSone = getCurrentSone(request.getToadletContext());
if (reply == null) {
- return new JsonObject().put("success", false).put("error", "invalid-reply-id");
+ return createErrorJsonObject("invalid-reply-id");
}
if (currentSone == null) {
- return new JsonObject().put("success", false).put("error", "auth-required");
+ return createErrorJsonObject("auth-required");
}
if (!reply.getSone().equals(currentSone)) {
- return new JsonObject().put("success", false).put("error", "not-authorized");
+ return createErrorJsonObject("not-authorized");
}
webInterface.getCore().deleteReply(reply);
- return new JsonObject().put("success", true);
+ return createSuccessJsonObject();
}
}