use of com.willshex.blogwt.client.api.blog.event.DeletePostEventHandler.DeletePostFailure in project blogwt by billy1380.
the class PostController method deletePost.
public void deletePost(Post post) {
final DeletePostRequest input = SessionController.get().setSession(ApiHelper.setAccessCode(new DeletePostRequest())).post(post);
ApiHelper.createBlogClient().deletePost(input, new AsyncCallback<DeletePostResponse>() {
@Override
public void onSuccess(DeletePostResponse output) {
if (output.status == StatusType.StatusTypeSuccess) {
if (input.post != null) {
fetchPosts();
}
}
DefaultEventBus.get().fireEventFromSource(new DeletePostSuccess(input, output), PostController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new DeletePostFailure(input, caught), PostController.this);
}
});
}
Aggregations