Skip to content

Commit

Permalink
Fix bug in get_ona_data to download only set columns
Browse files Browse the repository at this point in the history
  • Loading branch information
truenomad committed Oct 16, 2024
1 parent 9bd07f3 commit dbce8d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions R/get_ona.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ get_paginated_data <- function(api_url, api_token) {
repeat {

paged_url <- paste0(api_url,
"?page=", page_number,
"page=", page_number,
"&page_size=100000")

current_page <- get_ona_page(paged_url, api_token) |>
Expand Down Expand Up @@ -273,8 +273,10 @@ get_ona_data <- function(base_url = "https://api.whonghub.org", form_id,
collapse = ','), ']'))

# Build the full URL with query parameters using modify_url from httr
api_url <- httr::modify_url(api_url, query = query_params)
}
api_url <-
paste0(
httr::modify_url(api_url, query = query_params), "&")
} else { api_url <- paste0(api_url, "?") }

# Download data (use pagination if necessary) --------------------------------

Expand Down Expand Up @@ -312,7 +314,6 @@ get_ona_data <- function(base_url = "https://api.whonghub.org", form_id,
#' IDs, and includes from_id column.
#' @examples
#' # api_token <- "your_api_token_here"
#' # data <- get_multi_ona_data(form_ids = c(623, 432, 643), api_token)
#' @importFrom foreach %dopar%
#' @export
get_multi_ona_data <- function(base_url = "https://api.whonghub.org",
Expand Down
1 change: 0 additions & 1 deletion man/get_multi_ona_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbce8d8

Please sign in to comment.