From aa7e30e5f9434ec89b8ebb8ff2b2759cd3687533 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 7 Mar 2023 10:40:00 +0200 Subject: [PATCH] feat: show `paid` and `shipped` statues --- crud.py | 4 ++-- static/components/order-list/order-list.html | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/crud.py b/crud.py index be080b7..62e862f 100644 --- a/crud.py +++ b/crud.py @@ -364,7 +364,7 @@ async def get_order_by_event_id(user_id: str, event_id: str) -> Optional[Order]: async def get_orders(user_id: str) -> List[Order]: rows = await db.fetchall( - "SELECT * FROM nostrmarket.orders WHERE user_id = ?", + "SELECT * FROM nostrmarket.orders WHERE user_id = ? ORDER BY time DESC", (user_id,), ) return [Order.from_row(row) for row in rows] @@ -372,7 +372,7 @@ async def get_orders(user_id: str) -> List[Order]: async def get_orders_for_stall(user_id: str, stall_id: str) -> List[Order]: rows = await db.fetchall( - "SELECT * FROM nostrmarket.orders WHERE user_id = ? AND stall_id = ?", + "SELECT * FROM nostrmarket.orders WHERE user_id = ? AND stall_id = ? ORDER BY time DESC", ( user_id, stall_id, diff --git a/static/components/order-list/order-list.html b/static/components/order-list/order-list.html index 99c556a..2f086fa 100644 --- a/static/components/order-list/order-list.html +++ b/static/components/order-list/order-list.html @@ -23,9 +23,24 @@ {{toShortId(props.row.id)}} {{props.row.total}} + - {{props.row.paid}} - {{props.row.shipped}} + + + + + + {{toShortId(props.row.pubkey)}}