mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-26 15:42:30 +01:00
fix create edit delete permissions
This commit is contained in:
parent
2fed92e69a
commit
b11597b0de
2 changed files with 8 additions and 3 deletions
|
@ -1079,7 +1079,7 @@ new Vue({
|
||||||
.request(
|
.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/diagonalley/api/v1/stalls/' + stallId,
|
'/diagonalley/api/v1/stalls/' + stallId,
|
||||||
_.findWhere(self.g.user.wallets, {id: stall.wallet}).inkey
|
_.findWhere(self.g.user.wallets, {id: stall.wallet}).adminkey
|
||||||
)
|
)
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
self.stalls = _.reject(self.stalls, function (obj) {
|
self.stalls = _.reject(self.stalls, function (obj) {
|
||||||
|
|
|
@ -9,7 +9,12 @@ from starlette.exceptions import HTTPException
|
||||||
|
|
||||||
from lnbits.core.crud import get_user
|
from lnbits.core.crud import get_user
|
||||||
from lnbits.core.services import create_invoice
|
from lnbits.core.services import create_invoice
|
||||||
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
|
from lnbits.decorators import (
|
||||||
|
WalletTypeInfo,
|
||||||
|
get_key_type,
|
||||||
|
require_admin_key,
|
||||||
|
require_invoice_key,
|
||||||
|
)
|
||||||
|
|
||||||
from . import db, diagonalley_ext
|
from . import db, diagonalley_ext
|
||||||
from .crud import (
|
from .crud import (
|
||||||
|
@ -186,7 +191,7 @@ async def api_diagonalley_stalls(
|
||||||
async def api_diagonalley_stall_create(
|
async def api_diagonalley_stall_create(
|
||||||
data: createStalls,
|
data: createStalls,
|
||||||
stall_id: str = Query(None),
|
stall_id: str = Query(None),
|
||||||
wallet: WalletTypeInfo = Depends(get_key_type),
|
wallet: WalletTypeInfo = Depends(require_invoice_key),
|
||||||
):
|
):
|
||||||
|
|
||||||
if stall_id:
|
if stall_id:
|
||||||
|
|
Loading…
Add table
Reference in a new issue