diff --git a/templates/tpos/index.html b/templates/tpos/index.html
index f0c8ceb..4e778ee 100644
--- a/templates/tpos/index.html
+++ b/templates/tpos/index.html
@@ -862,11 +862,11 @@
return this.tposs.reduce((acc, tpos) => {
tpos.items.forEach(item => {
item.categories &&
- item.categories.forEach(category => {
- if (!acc.includes(category)) {
- acc.push(category)
- }
- })
+ item.categories.forEach(category => {
+ if (!acc.includes(category)) {
+ acc.push(category)
+ }
+ })
})
return acc
}, [])
@@ -952,7 +952,7 @@
},
createTPoS(wallet, data) {
LNbits.api
- .request('POST', '/tpos/api/v1/tposs', wallet.inkey, data)
+ .request('POST', '/tpos/api/v1/tposs', wallet.adminkey, data)
.then(response => {
this.tposs.push(mapTPoS(response.data))
this.closeFormDialog()
diff --git a/views_api.py b/views_api.py
index e68f071..d227b28 100644
--- a/views_api.py
+++ b/views_api.py
@@ -47,7 +47,7 @@ async def api_tposs(
@tpos_ext.post("/api/v1/tposs", status_code=HTTPStatus.CREATED)
async def api_tpos_create(
- data: CreateTposData, wallet: WalletTypeInfo = Depends(get_key_type)
+ data: CreateTposData, wallet: WalletTypeInfo = Depends(require_admin_key)
):
tpos = await create_tpos(wallet_id=wallet.wallet.id, data=data)
return tpos.dict()