Skip to content

Commit

Permalink
some basic checks when creating an empty plate that we are not adding…
Browse files Browse the repository at this point in the history
… duplicate barcodes
  • Loading branch information
bgpalmer committed Oct 26, 2022
1 parent 22b751a commit 7fc6d88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inst/sampleDB/server_helpers/AppMoveMicronixSamples.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ CreateEmptyMicronixPlate <- function(input, output, database){
)

if (CheckTable(database = database, table = "matrix_plate") %>%
filter(input$CreateEmptyMicronixPlateID == plate_name) %>%
filter(input$CreateEmptyMicronixPlateID == plate_name | plate_barcode == input$CreateEmptyMicronixPlateBarcode) %>%
nrow(.) > 0) {
showNotification("Plate name exists!", id = "MoveNotification", type = "error", action = NULL, duration = 3, closeButton = TRUE)
showNotification("Value would have created a duplicate!", id = "MoveNotification", type = "error", action = NULL, duration = 3, closeButton = TRUE)
} else if (nchar(input$CreateEmptyMicronixPlateBarcode) != 10) {
showNotification("Barcode must be 10 digits!", id = "MoveNotification", type = "error", action = NULL, duration = 3, closeButton = TRUE)
} else {
conn <- RSQLite::dbConnect(RSQLite::SQLite(), database)
RSQLite::dbBegin(conn)
Expand Down

0 comments on commit 7fc6d88

Please sign in to comment.