When returning boltcard data through api, send pin_enable and pin_limit_sats values as well
This commit is contained in:
parent
3d9e742dc1
commit
6609558f96
2 changed files with 7 additions and 3 deletions
6
db/db.go
6
db/db.go
|
|
@ -392,7 +392,7 @@ func Get_card_from_card_name(card_name string) (*Card, error) {
|
||||||
|
|
||||||
sqlStatement := `SELECT card_id, k2_cmac_key, uid,` +
|
sqlStatement := `SELECT card_id, k2_cmac_key, uid,` +
|
||||||
` last_counter_value, lnurlw_request_timeout_sec,` +
|
` last_counter_value, lnurlw_request_timeout_sec,` +
|
||||||
` lnurlw_enable, tx_limit_sats, day_limit_sats` +
|
` lnurlw_enable, tx_limit_sats, day_limit_sats, pin_enable, pin_limit_sats` +
|
||||||
` FROM cards WHERE card_name=$1 AND wiped = 'N';`
|
` FROM cards WHERE card_name=$1 AND wiped = 'N';`
|
||||||
row := db.QueryRow(sqlStatement, card_name)
|
row := db.QueryRow(sqlStatement, card_name)
|
||||||
err = row.Scan(
|
err = row.Scan(
|
||||||
|
|
@ -403,7 +403,9 @@ func Get_card_from_card_name(card_name string) (*Card, error) {
|
||||||
&c.Lnurlw_request_timeout_sec,
|
&c.Lnurlw_request_timeout_sec,
|
||||||
&c.Lnurlw_enable,
|
&c.Lnurlw_enable,
|
||||||
&c.Tx_limit_sats,
|
&c.Tx_limit_sats,
|
||||||
&c.Day_limit_sats)
|
&c.Day_limit_sats,
|
||||||
|
&c.Pin_enable,
|
||||||
|
&c.Pin_limit_sats)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &c, err
|
return &c, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,9 @@ func Getboltcard(w http.ResponseWriter, r *http.Request) {
|
||||||
`"uid": "` + c.Db_uid + `",` +
|
`"uid": "` + c.Db_uid + `",` +
|
||||||
`"lnurlw_enable": "` + c.Lnurlw_enable + `",` +
|
`"lnurlw_enable": "` + c.Lnurlw_enable + `",` +
|
||||||
`"tx_limit_sats": "` + strconv.Itoa(c.Tx_limit_sats) + `",` +
|
`"tx_limit_sats": "` + strconv.Itoa(c.Tx_limit_sats) + `",` +
|
||||||
`"day_limit_sats": "` + strconv.Itoa(c.Day_limit_sats) + `"}`)
|
`"day_limit_sats": "` + strconv.Itoa(c.Day_limit_sats) + `", ` +
|
||||||
|
`"pin_enable": "` + strconv.Itoa(c.Pin_enable) + `", ` +
|
||||||
|
`"pin_limit_sats": "` + strconv.Itoa(c.Pin_limit_sats) + `"}`)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue