feat: add ship/unship functionality
This commit is contained in:
parent
8094bcaf8a
commit
612d31eae0
5 changed files with 129 additions and 50 deletions
8
crud.py
8
crud.py
|
|
@ -392,10 +392,12 @@ async def update_order_paid_status(order_id: str, paid: bool) -> Optional[Order]
|
|||
return Order.from_row(row) if row else None
|
||||
|
||||
|
||||
async def update_order_shipped_status(order_id: str, shipped: bool) -> Optional[Order]:
|
||||
async def update_order_shipped_status(
|
||||
user_id: str, order_id: str, shipped: bool
|
||||
) -> Optional[Order]:
|
||||
await db.execute(
|
||||
f"UPDATE nostrmarket.orders SET shipped = ? WHERE id = ?",
|
||||
(order_id, shipped),
|
||||
f"UPDATE nostrmarket.orders SET shipped = ? WHERE user_id = ? AND id = ?",
|
||||
(shipped, user_id, order_id),
|
||||
)
|
||||
|
||||
row = await db.fetchone(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue