Switching lnurl links from model to crud

This commit is contained in:
arcbtc 2023-12-30 21:37:52 +00:00
parent c749da80dd
commit ba7e11e30d
14 changed files with 100 additions and 180 deletions

View file

@ -38,13 +38,13 @@ from .models import CreateTempData
@temp_ext.get("/api/v1/temps", status_code=HTTPStatus.OK)
async def api_temps(
all_wallets: bool = Query(False), wallet: WalletTypeInfo = Depends(get_key_type)
req: Request, all_wallets: bool = Query(False), wallet: WalletTypeInfo = Depends(get_key_type)
):
wallet_ids = [wallet.wallet.id]
if all_wallets:
user = await get_user(wallet.wallet.user)
wallet_ids = user.wallet_ids if user else []
return [temp.dict() for temp in await get_temps(wallet_ids)]
return [temp.dict() for temp in await get_temps(wallet_ids, req)]
## Get a specific record belonging to a user