feat: basic account UI

This commit is contained in:
Vlad Stan 2023-02-15 14:17:01 +02:00
parent 2099a8b7bb
commit d0f38346e3
7 changed files with 116 additions and 16 deletions

12
crud.py
View file

@ -374,3 +374,15 @@ async def get_account(
)
return NostrAccount.from_row(row) if row else None
async def get_accounts(
relay_id: str,
allowed = True,
blocked = False,
) -> List[NostrAccount]:
rows = await db.fetchall(
"SELECT * FROM nostrrelay.accounts WHERE relay_id = ? AND allowed = ? AND blocked = ?",
(relay_id, allowed, blocked),
)
return [NostrAccount.from_row(row) for row in rows]