Refresh token, spolecne lety s copilotem, lazy typ

This commit is contained in:
Michal Kváček
2023-07-29 23:27:24 +02:00
parent 77dd5538d3
commit fcd80f20e8
11 changed files with 133 additions and 38 deletions
+6 -2
View File
@@ -82,7 +82,11 @@ class EditPointOfInterestMutation:
# TODO: kontrola organizace
# TODO: kontrola opravneni na akci
poi = (await get_base_query(info.context.user_id, only_my=True).filter(models.Photo.id == id)).one()
poi = (
await info.context.db.scalars(
get_base_query(info.context.user_id, only_my=True)
.filter(models.PointOfInterest.id == id))
).one()
return await models.PointOfInterest.update(info.context.db, obj=poi, data=input.to_dict())
@@ -91,6 +95,6 @@ class DeletePointOfInterestMutation:
@strawberry.mutation
async def delete_point_of_interest(self, info, id: int) -> PointOfInterest:
poi = (await get_base_query(info.context.user_id, only_my=True).filter(models.Photo.id == id)).one()
poi = (await get_base_query(info.context.user_id, only_my=True).filter(models.PointOfInterest.id == id)).one()
return await models.PointOfInterest.update(info.context.db, obj=poi, data=dict(deleted=True))