Mazani letu (zatim jen zaklad), nastaveni cover fotky

This commit is contained in:
Michal Kváček
2023-07-24 17:31:28 +02:00
parent 81d4c73a1f
commit 77dd5538d3
7 changed files with 91 additions and 34 deletions
+3 -1
View File
@@ -11,7 +11,9 @@ AIRCRAFT_UPLOAD_DEST_PATH = "/app/uploads/aircrafts/"
@strawberry_sqlalchemy_type(models.Aircraft)
class Aircraft:
photo_url: Optional[str] = strawberry.field(resolver=lambda root: get_public_url(root.photo_filename))
photo_url: Optional[str] = strawberry.field(
resolver=lambda root: get_public_url(f"aircrafts/{root.photo_filename}") if root.photo_filename else None
)
def get_base_query(user_id: int):