Skip to content

Commit

Permalink
feat: allow category in /all
Browse files Browse the repository at this point in the history
  • Loading branch information
r3tr0ananas committed Aug 26, 2024
1 parent 4831c16 commit c61ba52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.8"
__version__ = "1.1.9"
9 changes: 7 additions & 2 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Tuple
from typing import List, Tuple, Optional

from fastapi import FastAPI
from fastapi.responses import RedirectResponse, JSONResponse, FileResponse
Expand Down Expand Up @@ -102,7 +102,12 @@ async def info():
}
},
)
async def all():
async def all(category: Optional[str] = None):
if category is not None:
return [
image.to_dict() for image in agac.images if image.category == category
]

return [
image.to_dict() for image in agac.images
]
Expand Down

0 comments on commit c61ba52

Please sign in to comment.