diff --git a/R/createSite.R b/R/createSite.R index 83018e5..7e99195 100644 --- a/R/createSite.R +++ b/R/createSite.R @@ -39,7 +39,7 @@ createSiteUI <- function(id) { ) } -validateSite <- function(input, lat, long){ +validateCreateSite <- function(input, lat, long){ feedbackWarning("user_site_id", input$user_site_id == "", "Value is required") feedbackWarning("site_name", input$site_name == "", "Value is required") feedbackWarning("install_date", toString(input$install_date) == "", "Value is required") @@ -83,7 +83,7 @@ createSiteServer <- function(id, gageSites) { # message(glue::glue("coords: {coords}")) observeEvent(input$btnSave, { - validateSite(input, coords$lat(), coords$long()) + validateCreateSite(input, coords$lat(), coords$long()) # message(glue::glue("lat:{coords$lat()}")) tryCatch({ diff --git a/R/editSite.R b/R/editSite.R index 8d476df..b3f45c2 100644 --- a/R/editSite.R +++ b/R/editSite.R @@ -64,7 +64,7 @@ isLongValid <- function(long) { ) } -validateSite <- function(input){ +validateEditSite <- function(input){ feedbackWarning("user_site_id", input$user_site_id == "", "Value is required") feedbackWarning("site_name", input$site_name == "", "Value is required") feedbackWarning("install_date", toString(input$install_date) == "", "Value is required") @@ -123,7 +123,7 @@ editSiteServer <- function(id, gageSites, selectedSite) { }) observeEvent(input$btnSave, { - validateSite(input) + validateEditSite(input) tryCatch({ updateSite(selectedSite()$site_id, input) gageSites(loadSites())