add routes for getting recently added items

This commit is contained in:
mungai-njoroge
2023-12-02 01:59:03 +03:00
parent 7749b4fc3c
commit b03e721ee5
9 changed files with 198 additions and 4 deletions
+4 -1
View File
@@ -3,7 +3,10 @@ from app.models import Album
def album_serializer(album: Album, to_remove: set[str]) -> dict:
album_dict = asdict(album)
try:
album_dict = asdict(album)
except TypeError:
return {}
to_remove.update(key for key in album_dict.keys() if key.startswith("is_"))
for key in to_remove:
+4 -1
View File
@@ -4,7 +4,10 @@ from app.models.artist import Artist
def serialize_for_card(artist: Artist):
artist_dict = asdict(artist)
try:
artist_dict = asdict(artist)
except TypeError:
return {}
props_to_remove = {
"is_favorite",