Fix flight update db issue
This commit is contained in:
parent
e93a27255a
commit
d61b473869
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user