feat: show customer names

This commit is contained in:
Vlad Stan 2023-03-27 17:36:08 +03:00
parent 89f46fff35
commit a719517b9c
5 changed files with 19 additions and 38 deletions

18
crud.py
View file

@ -464,14 +464,6 @@ async def get_orders_for_stall(merchant_id: str, stall_id: str) -> List[Order]:
return [Order.from_row(row) for row in rows]
async def get_public_keys_for_orders(merchant_id: str) -> List[str]:
rows = await db.fetchall(
"SELECT DISTINCT public_key FROM nostrmarket.orders WHERE merchant_id = ?",
(merchant_id,),
)
return [row[0] for row in rows]
async def get_last_order_time(public_key: str) -> int:
row = await db.fetchone(
"""
@ -598,14 +590,6 @@ async def delete_merchant_direct_messages(merchant_id: str) -> None:
)
async def get_public_keys_for_direct_messages(merchant_id: str) -> List[str]:
rows = await db.fetchall(
"SELECT DISTINCT public_key FROM nostrmarket.direct_messages WHERE merchant_id = ?",
(merchant_id),
)
return [row[0] for row in rows]
######################################## CUSTOMERS ########################################
@ -638,7 +622,7 @@ async def get_customer(merchant_id: str, public_key: str) -> Optional[Customer]:
return Customer.from_row(row) if row else None
async def get_cusomers(merchant_id: str) -> List[Customer]:
async def get_customers(merchant_id: str) -> List[Customer]:
rows = await db.fetchall(
"SELECT * FROM nostrmarket.customers WHERE merchant_id = ?", (merchant_id,)
)