mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-29 02:01:35 +02:00
key issues fixed
This commit is contained in:
@ -617,11 +617,12 @@ new Vue({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateWalletName: function () {
|
updateWalletName: function () {
|
||||||
|
console.log(this.newName, this.g)
|
||||||
let newName = this.newName
|
let newName = this.newName
|
||||||
|
let adminkey = this.g.wallet.adminkey
|
||||||
if (!newName || !newName.length) return
|
if (!newName || !newName.length) return
|
||||||
// let data = {name: newName}
|
|
||||||
LNbits.api
|
LNbits.api
|
||||||
.request('PUT', '/api/v1/wallet/' + newName, this.g.wallet.adminkey, {})
|
.request('PUT', '/api/v1/wallet/' + newName, adminkey, {})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.newName = ''
|
this.newName = ''
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
|
@ -7,7 +7,7 @@ from typing import Dict, List, Optional, Union
|
|||||||
from urllib.parse import ParseResult, parse_qs, urlencode, urlparse, urlunparse
|
from urllib.parse import ParseResult, parse_qs, urlencode, urlparse, urlunparse
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from fastapi import Query, Request, Header
|
from fastapi import Header, Query, Request
|
||||||
from fastapi.exceptions import HTTPException
|
from fastapi.exceptions import HTTPException
|
||||||
from fastapi.param_functions import Depends
|
from fastapi.param_functions import Depends
|
||||||
from fastapi.params import Body
|
from fastapi.params import Body
|
||||||
@ -23,7 +23,7 @@ from lnbits.decorators import (
|
|||||||
WalletInvoiceKeyChecker,
|
WalletInvoiceKeyChecker,
|
||||||
WalletTypeInfo,
|
WalletTypeInfo,
|
||||||
get_key_type,
|
get_key_type,
|
||||||
require_admin_key
|
require_admin_key,
|
||||||
)
|
)
|
||||||
from lnbits.helpers import url_for, urlsafe_short_hash
|
from lnbits.helpers import url_for, urlsafe_short_hash
|
||||||
from lnbits.requestvars import g
|
from lnbits.requestvars import g
|
||||||
@ -99,7 +99,7 @@ async def api_update_balance(
|
|||||||
|
|
||||||
@core_app.put("/api/v1/wallet/{new_name}")
|
@core_app.put("/api/v1/wallet/{new_name}")
|
||||||
async def api_update_wallet(
|
async def api_update_wallet(
|
||||||
new_name: str, wallet: WalletTypeInfo = Depends(WalletAdminKeyChecker())
|
new_name: str, wallet: WalletTypeInfo = Depends(require_admin_key)
|
||||||
):
|
):
|
||||||
await update_wallet(wallet.wallet.id, new_name)
|
await update_wallet(wallet.wallet.id, new_name)
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user