Lepsi stahovani informaci o pocasi

This commit is contained in:
Michal Kváček
2024-09-30 06:43:11 +02:00
parent 186dbd0720
commit ca3f6ef07c
14 changed files with 198 additions and 96 deletions
@@ -1,8 +1,6 @@
from operator import or_
from typing import Set, Optional
from sqlalchemy import and_
from database import models
from database.transaction import get_session
from graphql_schema.entities.helpers.combobox import handle_combobox_save
@@ -77,7 +75,7 @@ class AircraftMutationResolver(BaseMutationResolver):
return await self._do_create(db, data=input_data)
async def update(self, id: int, user_id: int, data: EditAircraftInput) -> Aircraft:
async def update(self, context, id: int, data: EditAircraftInput) -> Aircraft:
update_data = data.to_dict()
async with get_session() as db:
if data.organization:
@@ -85,7 +83,7 @@ class AircraftMutationResolver(BaseMutationResolver):
db,
models.Organization,
input=data.organization,
user_id=user_id,
user_id=context.user_id,
)
return await self._do_update(db, id, update_data)