API pro podporu vytvareni letu z planu

This commit is contained in:
Michal Kváček
2024-06-30 02:31:37 +02:00
parent ac3b496459
commit e541508f75
6 changed files with 132 additions and 8 deletions
@@ -52,9 +52,18 @@ class FlightPlanMutationResolver(BaseMutationResolver):
position = 0
for marker in markers:
if marker.type == 'poi':
assert bool(marker.point_of_interest_id)
if marker.type == 'airport':
assert bool(marker.airport_id)
await models.FlightPlanMarker.create(db, data={
"position": position,
"flight_plan_id": flight_plan.id,
"airport_id": marker.airport_id,
"point_of_interest_id": marker.point_of_interest_id,
"type": marker.type,
"name": marker.name,
"gps_latitude": marker.gps_latitude,