mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 10:39:59 +01:00
support all the currencies.
This commit is contained in:
parent
adc3e62573
commit
0bc66ea150
@ -24,7 +24,7 @@ new Vue({
|
||||
itemDialog: {
|
||||
show: false,
|
||||
data: {...defaultItemData},
|
||||
units: ['sat', 'USD']
|
||||
units: ['sat']
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -207,5 +207,14 @@ new Vue({
|
||||
created() {
|
||||
this.selectedWallet = this.g.user.wallets[0]
|
||||
this.loadShop()
|
||||
|
||||
LNbits.api
|
||||
.request('GET', '/offlineshop/api/v1/currencies')
|
||||
.then(response => {
|
||||
this.itemDialog = {...this.itemDialog, units: ['sat', ...response.data]}
|
||||
})
|
||||
.catch(err => {
|
||||
LNbits.utils.notifyApiError(err)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -3,6 +3,7 @@ from http import HTTPStatus
|
||||
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
|
||||
|
||||
from lnbits.decorators import api_check_wallet_key, api_validate_post_request
|
||||
from lnbits.utils.exchange_rates import currencies
|
||||
|
||||
from . import offlineshop_ext
|
||||
from .crud import (
|
||||
@ -16,6 +17,11 @@ from .crud import (
|
||||
from .models import ShopCounter
|
||||
|
||||
|
||||
@offlineshop_ext.route("/api/v1/currencies", methods=["GET"])
|
||||
async def api_list_currencies_available():
|
||||
return jsonify(list(currencies.keys()))
|
||||
|
||||
|
||||
@offlineshop_ext.route("/api/v1/offlineshop", methods=["GET"])
|
||||
@api_check_wallet_key("invoice")
|
||||
async def api_shop_from_wallet():
|
||||
@ -51,7 +57,7 @@ async def api_shop_from_wallet():
|
||||
"description": {"type": "string", "empty": False, "required": True},
|
||||
"image": {"type": "string", "required": False, "nullable": True},
|
||||
"price": {"type": "number", "required": True},
|
||||
"unit": {"type": "string", "allowed": ["sat", "USD"], "required": True},
|
||||
"unit": {"type": "string", "required": True},
|
||||
}
|
||||
)
|
||||
async def api_add_or_update_item(item_id=None):
|
||||
|
Loading…
Reference in New Issue
Block a user