remove UNIQUE from cards.card_name

This commit is contained in:
Peter Rounce 2023-02-28 15:47:37 +00:00
parent 9dc6d70ba4
commit 62c0db37d5
5 changed files with 29 additions and 33 deletions

View file

@ -58,6 +58,12 @@ func Createboltcard(w http.ResponseWriter, r *http.Request) {
}
card_name := r.URL.Query().Get("card_name")
if card_name == "" {
msg := "createboltcard: the card name must be set"
log.Warn(msg)
resp_err.Write_message(w, msg)
return
}
uid_privacy_flag_str := r.URL.Query().Get("uid_privacy")
uid_privacy_flag, err := strconv.ParseBool(uid_privacy_flag_str)

View file

@ -18,21 +18,6 @@ func Getboltcard(w http.ResponseWriter, r *http.Request) {
}
card_name := r.URL.Query().Get("card_name")
// check if card_name exists
card_count, err := db.Get_card_name_count(card_name)
if err != nil {
log.Warn(err.Error())
return
}
if card_count == 0 {
msg := "getboltcard: the card name does not exist in the database"
log.Warn(msg)
resp_err.Write_message(w, msg)
return
}
// log the request
log.WithFields(log.Fields{
@ -42,7 +27,7 @@ func Getboltcard(w http.ResponseWriter, r *http.Request) {
c, err := db.Get_card_from_card_name(card_name)
if err != nil {
msg := "getboltcard: the card name does not exist in the database"
msg := "getboltcard: a non-wiped card with the card_name does not exist in the database"
log.Warn(msg)
resp_err.Write_message(w, msg)
return

View file

@ -32,7 +32,7 @@ func Wipeboltcard(w http.ResponseWriter, r *http.Request) {
card_count, err := db.Get_card_name_count(card_name)
if card_count == 0 {
msg := "the card name does not exist in the database"
msg := "wipeboltcard: the card name does not exist in the database"
log.Warn(msg)
resp_err.Write_message(w, msg)
return