Fix flight update db issue

This commit is contained in:
april 2024-01-05 15:35:03 -06:00
parent e93a27255a
commit d61b473869

View File

@ -70,7 +70,7 @@ async def update_flight(body: FlightCreateSchema, id: str) -> FlightDisplaySchem
if flight is None: if flight is None:
raise HTTPException(404, "Flight not found") 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 return updated_flight.upserted_id