Skip to content

Commit

Permalink
Vectorized version of osm_delete_gpx()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaspons committed Jun 13, 2024
1 parent ed056f2 commit dbb3a3f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
19 changes: 19 additions & 0 deletions R/osm_delete_gpx.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Vectorized version of .osm_delete_gpx()

#' Delete GPS traces
#'
#' Use this to delete GPX files. Only usable by the owner account. Requires authentication.
#'
#' @param gpx_id The track ids represented by a numeric or a character vector.
#'
#' @return Returns `NULL` invisibly.
#' @family edit GPS traces' functions
#' @export
#'
#' @examples
#' vignette("how_to_edit_gps_traces", package = "osmapiR")
osm_delete_gpx <- function(gpx_id) {
lapply(gpx_id, .osm_delete_gpx)

invisible()
}
6 changes: 3 additions & 3 deletions R/osmapi_gps_traces.R
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ osm_update_gpx <- function(gpx_id, name, description, tags,
#' @param gpx_id The track id represented by a numeric or a character value.
#'
#' @return Returns `NULL` invisibly.
#' @family edit GPS traces' functions
#' @export
# @family edit GPS traces' functions
#' @noRd
#'
#' @examples
#' vignette("how_to_edit_gps_traces", package = "osmapiR")
osm_delete_gpx <- function(gpx_id) {
.osm_delete_gpx <- function(gpx_id) {
req <- osmapi_request(authenticate = TRUE)
req <- httr2::req_method(req, "DELETE")
req <- httr2::req_url_path_append(req, "gpx", gpx_id)
Expand Down
8 changes: 4 additions & 4 deletions man/osm_delete_gpx.Rd

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

0 comments on commit dbb3a3f

Please sign in to comment.