feat: Implement favorites management API; add endpoints for adding, removing, and retrieving favorites for sounds and playlists
feat: Create Favorite model and repository for managing user favorites in the database feat: Add FavoriteService to handle business logic for favorites management feat: Enhance Playlist and Sound response schemas to include favorite indicators and counts refactor: Update API routes to include favorites functionality in playlists and sounds
This commit is contained in:
@@ -5,6 +5,7 @@ from sqlmodel import Field, Relationship
|
||||
from app.models.base import BaseModel
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from app.models.favorite import Favorite
|
||||
from app.models.playlist_sound import PlaylistSound
|
||||
from app.models.user import User
|
||||
|
||||
@@ -23,3 +24,4 @@ class Playlist(BaseModel, table=True):
|
||||
# relationships
|
||||
user: "User" = Relationship(back_populates="playlists")
|
||||
playlist_sounds: list["PlaylistSound"] = Relationship(back_populates="playlist")
|
||||
favorites: list["Favorite"] = Relationship(back_populates="playlist")
|
||||
|
||||
Reference in New Issue
Block a user