Merge pull request #438 from lnbits/usermanager_api_fix
Fix UserManager endpoint collision (FastAPI)
This commit is contained in:
commit
1609280f53
4 changed files with 8 additions and 8 deletions
|
|
@ -2,6 +2,7 @@ from sqlite3 import Row
|
|||
|
||||
from fastapi.param_functions import Query
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class CreateUserData(BaseModel):
|
||||
|
|
@ -22,8 +23,8 @@ class Users(BaseModel):
|
|||
id: str
|
||||
name: str
|
||||
admin: str
|
||||
email: str
|
||||
password: str
|
||||
email: Optional[str] = None
|
||||
password: Optional[str] = None
|
||||
|
||||
|
||||
class Wallets(BaseModel):
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from .crud import (
|
|||
)
|
||||
from .models import CreateUserData, CreateUserWallet
|
||||
|
||||
### Users
|
||||
# Users
|
||||
|
||||
|
||||
@usermanager_ext.get("/api/v1/users", status_code=HTTPStatus.OK)
|
||||
|
|
@ -63,7 +63,7 @@ async def api_usermanager_users_delete(
|
|||
raise HTTPException(status_code=HTTPStatus.NO_CONTENT)
|
||||
|
||||
|
||||
###Activate Extension
|
||||
# Activate Extension
|
||||
|
||||
|
||||
@usermanager_ext.post("/api/v1/extensions")
|
||||
|
|
@ -79,7 +79,7 @@ async def api_usermanager_activate_extension(
|
|||
return {"extension": "updated"}
|
||||
|
||||
|
||||
###Wallets
|
||||
# Wallets
|
||||
|
||||
|
||||
@usermanager_ext.post("/api/v1/wallets")
|
||||
|
|
@ -98,7 +98,7 @@ async def api_usermanager_wallets(wallet: WalletTypeInfo = Depends(get_key_type)
|
|||
return [wallet.dict() for wallet in await get_usermanager_wallets(admin_id)]
|
||||
|
||||
|
||||
@usermanager_ext.get("/api/v1/wallets/{wallet_id}")
|
||||
@usermanager_ext.get("/api/v1/transactions/{wallet_id}")
|
||||
async def api_usermanager_wallet_transactions(
|
||||
wallet_id, wallet: WalletTypeInfo = Depends(get_key_type)
|
||||
):
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class Jinja2Templates(templating.Jinja2Templates):
|
|||
def get_environment(self, loader: "jinja2.BaseLoader") -> "jinja2.Environment":
|
||||
@jinja2.contextfunction
|
||||
def url_for(context: dict, name: str, **path_params: typing.Any) -> str:
|
||||
request: Request = context["request"] # type: starlette.requests.Request
|
||||
request: Request = context["request"]
|
||||
return request.app.url_path_for(name, **path_params)
|
||||
|
||||
def url_params_update(init: QueryParams, **new: typing.Any) -> QueryParams:
|
||||
|
|
|
|||
1
mypy.ini
1
mypy.ini
|
|
@ -1,2 +1 @@
|
|||
[mypy]
|
||||
plugins = trio_typing.plugin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue