Skip to content

Commit

Permalink
fix duplicate validateSite named functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarneytu committed Apr 18, 2023
1 parent d980251 commit 2015f55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/createSite.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions R/editSite.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -123,7 +123,7 @@ editSiteServer <- function(id, gageSites, selectedSite) {
})

observeEvent(input$btnSave, {
validateSite(input)
validateEditSite(input)
tryCatch({
updateSite(selectedSite()$site_id, input)
gageSites(loadSites())
Expand Down

0 comments on commit 2015f55

Please sign in to comment.