Skip to content

Commit

Permalink
get rid of native pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahParry committed Dec 27, 2023
1 parent faa2a19 commit e710d82
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions R/get-estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ get_layer_estimates <- function(x, token = Sys.getenv("ARCGIS_TOKEN")) {

# token bug :[
if (token != "") {
resp <-
httr2::req_url_query(est_req, f = "json") |>
httr2::req_auth_bearer_token(token) |>
httr2::req_perform()
req <-
httr2::req_auth_bearer_token(
httr2::req_url_query(est_req, f = "json"),
token
)
resp <- httr2::req_perform(req)
} else {
resp <-
httr2::req_url_query(est_req, f = "json") |>
httr2::req_perform()
httr2::req_perform(
httr2::req_url_query(est_req, f = "json")
)
}

# process json string
res_raw <- httr2::resp_body_string(resp) |>
RcppSimdJson::fparse()
res_raw <- RcppSimdJson::fparse(httr2::resp_body_string(resp))

# process extent if present
ext <- res_raw[["extent"]]
Expand Down

0 comments on commit e710d82

Please sign in to comment.