feat(api): add exact-match name filter to list endpoints

This commit is contained in:
Mark Paronyan committed 2026-10-07 13:40:34 +03:00
1 parent 2fb7056cb9
commit 852dc5be0f
11 files changed
+167 -6

No files matched your search

+3 -1
View File
@@ -83,7 +83,7 @@ class ImagesRepository(BaseRepository):
except (OSError, InvalidImageError):
return False
async def get_images(self, image_type=None, availability=None) -> List[models.Image]:
async def get_images(self, image_type=None, availability=None, name=None) -> List[models.Image]:
"""
Get all images.
"""
@@ -94,6 +94,8 @@ class ImagesRepository(BaseRepository):
query = select(models.Image)
if availability:
query = query.where(models.Image.availability == availability)
if name is not None:
query = query.where(models.Image.filename == name)
result = await self._db_session.execute(query)
return list(result.scalars().all())