From d61b4738695f83380b05b93a8d8d356d452d0274 Mon Sep 17 00:00:00 2001 From: april Date: Fri, 5 Jan 2024 15:35:03 -0600 Subject: [PATCH] Fix flight update db issue --- api/database/flights.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/database/flights.py b/api/database/flights.py index 5a6f5fc..09b09c2 100644 --- a/api/database/flights.py +++ b/api/database/flights.py @@ -70,7 +70,7 @@ async def update_flight(body: FlightCreateSchema, id: str) -> FlightDisplaySchem if flight is None: raise HTTPException(404, "Flight not found") - updated_flight = await flight_collection.update_one({"_id": ObjectId(id)}, {"$set": body}) + updated_flight = await flight_collection.update_one({"_id": ObjectId(id)}, {"$set": body.model_dump()}) return updated_flight.upserted_id