Skip to content

Commit

Permalink
fix: correct function name in YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinFay committed Sep 16, 2022
1 parent 90de506 commit 897a011
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions R/manage_endpoints.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,17 @@ add_endpoint <- function(
eval.expr = FALSE
)

fct_name <- sprintf(
"%s_%s",
tolower(method),
name
)

if (is.null(yml$handles[[name_yaml]])) {
yml$handles[[name_yaml]] <- list(
methods = method,
path = sprintf("/%s", name),
handler = name
handler = fct_name
)
} else {
cli_alert_danger(
Expand All @@ -84,11 +90,7 @@ add_endpoint <- function(
mariobox_yaml_path
)

fct_name <- sprintf(
"%s_%s",
tolower(method),
name
)

usethis_use_r(
name = fct_name,
open = open,
Expand Down

0 comments on commit 897a011

Please sign in to comment.