Skip to content

Commit

Permalink
remove unnecisary dataset name checks get_latest_resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ross-hull committed Jul 31, 2024
1 parent 4e2da8e commit 1ea8c6e
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions R/get_latest_resource.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,8 @@ get_latest_resource <- function(dataset_name,
"prescriptions-in-the-community", "community-pharmacy-contractor-activity"
)

# throw error if name type/format is invalid
check_dataset_name(dataset_name)

# define query and try API call
query <- list("id" = dataset_name)
content <- try(
phs_GET("package_show", query),
silent = TRUE
)

# if content contains a 'Not Found Error'
# throw error with suggested dataset name
if (grepl("Not Found Error", content[1])) {
suggest_dataset_name(dataset_name)
}

# check if data set is within applicable datasets
# throw error if not
Expand Down

0 comments on commit 1ea8c6e

Please sign in to comment.