use of com.google.gerrit.server.change.SetHashtagsOp in project gerrit by GerritCodeReview.
the class PostHashtags method apply.
@Override
public Response<ImmutableSortedSet<String>> apply(ChangeResource req, HashtagsInput input) throws RestApiException, UpdateException, PermissionBackendException {
req.permissions().check(ChangePermission.EDIT_HASHTAGS);
try (BatchUpdate bu = updateFactory.create(req.getChange().getProject(), req.getUser(), TimeUtil.now())) {
SetHashtagsOp op = hashtagsFactory.create(input);
bu.addOp(req.getId(), op);
bu.execute();
return Response.ok(op.getUpdatedHashtags());
}
}
Aggregations