R/repo_unwatch.R

Defines functions repo_unwatch github_api_repo_unwatch

Documented in repo_unwatch

github_api_repo_unwatch = function(repo){
  ghclass_api_v3_req(
    endpoint = "DELETE /repos/:owner/:repo/subscription",
    owner = get_repo_owner(repo),
    repo = get_repo_name(repo)
  )

}

#' @rdname repo_notification
#' @export
#'
repo_unwatch = function(repo) {
  arg_is_chr(repo)

  res = purrr::map(
    repo,
    function(repo) {
      res = purrr::safely(github_api_repo_unwatch)(repo)

      status_msg(
        res,
        "Unwatched repo {.val {repo}}.",
        "Failed to unwatch repo {.val {repo}}."
      )
    }
  )

  invisible(res)
}

Try the ghclass package in your browser

Any scripts or data that you put into this service are public.

ghclass documentation built on May 29, 2024, 8:44 a.m.