add day_max to /updateboltcard
This commit is contained in:
parent
566f8a7b8c
commit
7888b71f8d
3 changed files with 17 additions and 8 deletions
|
|
@ -16,6 +16,15 @@ func Updateboltcard(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
enable_flag_str := r.URL.Query().Get("enable")
|
||||
enable_flag, err := strconv.ParseBool(enable_flag_str)
|
||||
if err != nil {
|
||||
msg := "updateboltcard: enable is not a valid boolean"
|
||||
log.Warn(msg)
|
||||
resp_err.Write_message(w, msg)
|
||||
return
|
||||
}
|
||||
|
||||
tx_max_str := r.URL.Query().Get("tx_max")
|
||||
tx_max, err := strconv.Atoi(tx_max_str)
|
||||
if err != nil {
|
||||
|
|
@ -25,10 +34,10 @@ func Updateboltcard(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
enable_flag_str := r.URL.Query().Get("enable")
|
||||
enable_flag, err := strconv.ParseBool(enable_flag_str)
|
||||
day_max_str := r.URL.Query().Get("day_max")
|
||||
day_max, err := strconv.Atoi(day_max_str)
|
||||
if err != nil {
|
||||
msg := "updateboltcard: enable is not a valid boolean"
|
||||
msg := "updateboltcard: day_max is not a valid integer"
|
||||
log.Warn(msg)
|
||||
resp_err.Write_message(w, msg)
|
||||
return
|
||||
|
|
@ -59,7 +68,7 @@ func Updateboltcard(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// update the card record
|
||||
|
||||
err = db.Update_card(card_name, tx_max, enable_flag)
|
||||
err = db.Update_card(card_name, enable_flag, tx_max, day_max)
|
||||
if err != nil {
|
||||
log.Warn(err.Error())
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue