format
This commit is contained in:
parent
6787e4916e
commit
6996155cae
2 changed files with 30 additions and 12 deletions
|
|
@ -201,7 +201,11 @@
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
<q-dialog v-model="addressFormDialog.show" position="top" @hide="closeAddressFormDialog">
|
<q-dialog
|
||||||
|
v-model="addressFormDialog.show"
|
||||||
|
position="top"
|
||||||
|
@hide="closeAddressFormDialog"
|
||||||
|
>
|
||||||
<q-card class="q-pa-lg q-pt-xl" style="width: 500px">
|
<q-card class="q-pa-lg q-pt-xl" style="width: 500px">
|
||||||
<q-form @submit="saveAddress" class="q-gutter-md">
|
<q-form @submit="saveAddress" class="q-gutter-md">
|
||||||
<q-select
|
<q-select
|
||||||
|
|
@ -576,16 +580,21 @@
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post(
|
.post(
|
||||||
'/nostrnip5/api/v1/domain/' + formDialog.data.domain_id + '/address',
|
'/nostrnip5/api/v1/domain/' +
|
||||||
|
formDialog.data.domain_id +
|
||||||
|
'/address',
|
||||||
formDialog.data
|
formDialog.data
|
||||||
)
|
)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
return LNbits.api
|
return LNbits.api.request(
|
||||||
.request(
|
'POST',
|
||||||
'POST',
|
'/nostrnip5/api/v1/domain/' +
|
||||||
'/nostrnip5/api/v1/domain/' + formDialog.data.domain_id + '/address/' + response.data.address_id + '/activate',
|
formDialog.data.domain_id +
|
||||||
_.findWhere(self.g.user.wallets, {id: domain.wallet}).adminkey
|
'/address/' +
|
||||||
)
|
response.data.address_id +
|
||||||
|
'/activate',
|
||||||
|
_.findWhere(self.g.user.wallets, {id: domain.wallet}).adminkey
|
||||||
|
)
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
self.addressFormDialog.data = {}
|
self.addressFormDialog.data = {}
|
||||||
|
|
@ -637,7 +646,7 @@
|
||||||
domainOptions: function () {
|
domainOptions: function () {
|
||||||
return this.domains.map(el => {
|
return this.domains.map(el => {
|
||||||
return {
|
return {
|
||||||
label: el.domain,
|
label: el.domain,
|
||||||
value: el.id
|
value: el.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ from lnbits.utils.exchange_rates import fiat_amount_as_satoshis
|
||||||
|
|
||||||
from . import nostrnip5_ext
|
from . import nostrnip5_ext
|
||||||
from .crud import (
|
from .crud import (
|
||||||
|
activate_address,
|
||||||
create_address_internal,
|
create_address_internal,
|
||||||
create_domain_internal,
|
create_domain_internal,
|
||||||
delete_address,
|
delete_address,
|
||||||
|
|
@ -25,7 +26,6 @@ from .crud import (
|
||||||
get_domain,
|
get_domain,
|
||||||
get_domain_by_name,
|
get_domain_by_name,
|
||||||
get_domains,
|
get_domains,
|
||||||
activate_address,
|
|
||||||
)
|
)
|
||||||
from .models import CreateAddressData, CreateDomainData
|
from .models import CreateAddressData, CreateDomainData
|
||||||
|
|
||||||
|
|
@ -98,7 +98,11 @@ async def api_address_delete(
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@nostrnip5_ext.post("/api/v1/domain/{domain_id}/address/{address_id}/activate", status_code=HTTPStatus.OK)
|
|
||||||
|
@nostrnip5_ext.post(
|
||||||
|
"/api/v1/domain/{domain_id}/address/{address_id}/activate",
|
||||||
|
status_code=HTTPStatus.OK,
|
||||||
|
)
|
||||||
async def api_address_activate(
|
async def api_address_activate(
|
||||||
domain_id: str,
|
domain_id: str,
|
||||||
address_id: str,
|
address_id: str,
|
||||||
|
|
@ -108,6 +112,7 @@ async def api_address_activate(
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@nostrnip5_ext.post(
|
@nostrnip5_ext.post(
|
||||||
"/api/v1/domain/{domain_id}/address", status_code=HTTPStatus.CREATED
|
"/api/v1/domain/{domain_id}/address", status_code=HTTPStatus.CREATED
|
||||||
)
|
)
|
||||||
|
|
@ -161,7 +166,11 @@ async def api_address_create(
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e))
|
raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e))
|
||||||
|
|
||||||
return {"payment_hash": payment_hash, "payment_request": payment_request, "address_id": address.id}
|
return {
|
||||||
|
"payment_hash": payment_hash,
|
||||||
|
"payment_request": payment_request,
|
||||||
|
"address_id": address.id,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@nostrnip5_ext.get(
|
@nostrnip5_ext.get(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue