Skip to content

Commit 77975be

Browse files
committed
delivery names and dates through relationship
I had forgotten to commit this
1 parent ddb4690 commit 77975be

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/modules/amap/endpoints_amap.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,16 @@ async def get_orders_of_user(
970970
db=db,
971971
order_id=order.order_id,
972972
)
973-
res.append(schemas_amap.OrderReturn(productsdetail=products, **order.__dict__))
973+
if order is None:
974+
raise HTTPException(status_code=404, detail="at least one order not found")
975+
res.append(
976+
schemas_amap.OrderReturn(
977+
productsdetail=products,
978+
delivery_date=order.delivery.delivery_date,
979+
delivery_name=order.delivery.name,
980+
**order.__dict__,
981+
)
982+
)
974983
return res
975984

976985

0 commit comments

Comments
 (0)