working /updateboltcard
This commit is contained in:
parent
5c3bb68995
commit
775996c8e4
3 changed files with 10 additions and 10 deletions
|
|
@ -16,10 +16,10 @@ func Updateboltcard(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
tx_max_str := r.URL.Query().Get("tx_max")
|
||||
tx_max, err := strconv.Atoi(tx_max_str)
|
||||
tx_limit_sats_str := r.URL.Query().Get("tx_limit_sats")
|
||||
tx_limit_sats, err := strconv.Atoi(tx_limit_sats_str)
|
||||
if err != nil {
|
||||
msg := "updateboltcard: tx_max is not a valid integer"
|
||||
msg := "updateboltcard: tx_limit_sats is not a valid integer"
|
||||
log.Warn(msg)
|
||||
resp_err.Write_message(w, msg)
|
||||
return
|
||||
|
|
@ -54,12 +54,12 @@ func Updateboltcard(w http.ResponseWriter, r *http.Request) {
|
|||
// log the request
|
||||
|
||||
log.WithFields(log.Fields{
|
||||
"card_name": card_name, "tx_max": tx_max,
|
||||
"enable": enable_flag}).Info("createboltcard API request")
|
||||
"card_name": card_name, "tx_limit_sats": tx_limit_sats,
|
||||
"enable": enable_flag}).Info("updateboltcard API request")
|
||||
|
||||
// update the card record
|
||||
|
||||
err = db.Update_card(card_name, tx_max, enable_flag)
|
||||
err = db.Update_card(card_name, tx_limit_sats, enable_flag)
|
||||
if err != nil {
|
||||
log.Warn(err.Error())
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue