Skip to content

Commit

Permalink
Add match.arg check for server options
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Eilertsen committed Mar 24, 2022
1 parent 7df3abb commit 705cc27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ check_status <- function(res, parsed) {
#' @noRd
build_url <- function(server, endpoint, api_version) {
base_url <- select_base_url(server = server)

sprintf("%s/%s/%s", base_url, api_version, endpoint)
}

Expand Down Expand Up @@ -132,6 +131,7 @@ parse_response <- function(res, simplify) {
#' @noRd
select_base_url <- function(server) {
if (!is.null(server)) {
match.arg(server, c("prod", "qa", "dev"))
if (server %in% c("qa", "dev")) {
if (server == "qa") base_url <- Sys.getenv("PIP_QA_URL")
if (server == "dev") base_url <- Sys.getenv("PIP_DEV_URL")
Expand Down

0 comments on commit 705cc27

Please sign in to comment.