use of com.meisolsson.githubsdk.service.issues.IssueLabelService in project gh4a by slapperwan.
the class IssueLabelListActivity method editLabel.
private void editLabel(IssueLabelAdapter.EditableLabel label) {
Label oldLabel = label.base();
String errorMessage = getString(R.string.issue_error_edit_label, oldLabel.name());
IssueLabelService service = ServiceFactory.get(IssueLabelService.class, false);
Label newLabel = Label.builder().name(label.editedName).color(label.editedColor).build();
service.editLabel(mRepoOwner, mRepoName, oldLabel.name(), newLabel).map(ApiHelpers::throwOnFailure).compose(RxUtils.wrapForBackgroundTask(this, R.string.saving_msg, errorMessage)).subscribe(result -> {
loadLabels(true);
setResult(RESULT_OK);
}, error -> handleActionFailure("Editing label failed", error));
}
Aggregations