Skip to content

Missingness and API Calls #3

@coatless

Description

@coatless

Consider:

repo_transfer = function(owner, repo, new_owner, team_id = NA) {
  if( is.na(team_id) ) {
    gh("POST /repos/:owner/:repo/transfer",
       owner = owner,
       repo = repo,
       new_owner = new_owner)
  } else {
    gh("POST /repos/:owner/:repo/transfer",
       owner = owner,
       repo = repo,
       new_owner = new_owner,
       team_id = team_id)
  }
}

There is a lot of code duplication.

Perhaps a variant of do.call with the parameters being added into a list() is better suited to this endeavor. Unless, there is something I'm overlooking in terms of evoking gh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions