From 3c45acc4d5131c79cc0d25a7461da827f1f26c8a Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 17 Jul 2023 10:49:03 +0100 Subject: [PATCH] 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 --- crud.py | 7 +++++-- static/components/relay-details/relay-details.html | 1 - static/components/relay-details/relay-details.js | 1 - views_api.py | 7 ++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/crud.py b/crud.py index 824c0bb..b4445dd 100644 --- a/crud.py +++ b/crud.py @@ -391,9 +391,12 @@ async def get_accounts( allowed=True, blocked=False, ) -> List[NostrAccount]: + + if not allowed and not blocked: + return [] + rows = await db.fetchall( - "SELECT * FROM nostrrelay.accounts WHERE relay_id = ? AND allowed = ? AND blocked = ?", + "SELECT * FROM nostrrelay.accounts WHERE relay_id = ? AND allowed = ? OR blocked = ?", (relay_id, allowed, blocked), ) - return [NostrAccount.from_row(row) for row in rows] diff --git a/static/components/relay-details/relay-details.html b/static/components/relay-details/relay-details.html index 8896a0d..d8c7685 100644 --- a/static/components/relay-details/relay-details.html +++ b/static/components/relay-details/relay-details.html @@ -609,7 +609,6 @@ row-key="pubkey" :columns="accountsTable.columns" :pagination.sync="accountsTable.pagination" - :filter="accountsFilter" >