use of app.insti.api.request.CommentCreateRequest in project IITB-App by wncc.
the class ComplaintDetailsFragment method postComment.
private void postComment() {
final CommentCreateRequest commentCreateRequest = new CommentCreateRequest(editTextComment.getText().toString());
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.postComment(Utils.getSessionIDHeader(), cId, commentCreateRequest).enqueue(new Callback<Venter.Comment>() {
@Override
public void onResponse(Call<Venter.Comment> call, Response<Venter.Comment> response) {
if (response.isSuccessful()) {
Venter.Comment comment = response.body();
addNewComment(comment);
editTextComment.setText(null);
}
}
@Override
public void onFailure(Call<Venter.Comment> call, Throwable t) {
Log.i(TAG, "failure in posting comments: " + t.toString());
}
});
}
Aggregations