copy changes

more copy
clean debugging... prints! lol
clean console logs
fix get users

Only get users that explicitly have been allowed or blocked
UI
UI-2
prevent getting all accounts (false, false is default)
remove client side filtering


remove prints
This commit is contained in:
Tiago Vasconcelos 2023-07-17 10:49:03 +01:00 committed by Vlad Stan
parent 07a07fc079
commit 3c45acc4d5
4 changed files with 9 additions and 7 deletions

View file

@ -195,6 +195,7 @@ async def api_create_or_update_account(
try:
data.pubkey = normalize_public_key(data.pubkey)
account = await get_account(data.relay_id, data.pubkey)
if not account:
account = NostrAccount(
@ -208,7 +209,7 @@ async def api_create_or_update_account(
account.blocked = data.blocked
if data.allowed is not None:
account.allowed = data.allowed
return await update_account(data.relay_id, account)
except ValueError as ex:
@ -256,8 +257,8 @@ async def api_delete_account(
@nostrrelay_ext.get("/api/v1/account")
async def api_get_accounts(
relay_id: str,
allowed=False,
blocked=True,
allowed: bool = False,
blocked: bool = True,
wallet: WalletTypeInfo = Depends(require_invoice_key),
) -> List[NostrAccount]:
try: