use of com.gh4a.utils.ApiHelpers in project gh4a by slapperwan.
the class EditPullRequestDiffCommentActivity method editComment.
@Override
protected Single<GitHubCommentBase> editComment(String repoOwner, String repoName, long commentId, String body) {
PullRequestReviewCommentService service = ServiceFactory.get(PullRequestReviewCommentService.class, false);
CommentRequest request = CommentRequest.builder().body(body).build();
return service.editReviewComment(repoOwner, repoName, commentId, request).map(ApiHelpers::throwOnFailure);
}
use of com.gh4a.utils.ApiHelpers in project gh4a by slapperwan.
the class HomeActivity method loadUserInfo.
private void loadUserInfo(boolean force) {
UserService service = ServiceFactory.get(UserService.class, force);
service.getUser(mUserLogin).map(ApiHelpers::throwOnFailure).compose(makeLoaderSingle(ID_LOADER_USER, force)).subscribe(result -> {
Gh4Application.get().setCurrentAccountInfo(result);
mUserInfo = result;
updateUserInfo();
}, this::handleLoadFailure);
}
use of com.gh4a.utils.ApiHelpers in project gh4a by slapperwan.
the class CommitNoteAdapter method addReaction.
@Override
public Single<Reaction> addReaction(ReactionBar.Item item, String content) {
GitComment comment = ((ViewHolder) item).mBoundItem;
ReactionService service = ServiceFactory.get(ReactionService.class, false);
ReactionRequest request = ReactionRequest.builder().content(content).build();
return service.createCommitCommentReaction(mRepoOwner, mRepoName, comment.id(), request).map(ApiHelpers::throwOnFailure);
}
Aggregations