highlife-15d6hb/endpoints/playlist.get.py
2025-03-28 18:34:30 +00:00

17 lines
540 B
Python

from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from models.playlist import Playlist
from schemas.playlist import PlaylistSchema
from helpers.playlist_helpers import get_all_playlists
router = APIRouter()
@router.get("/playlist", status_code=200, response_model=List[PlaylistSchema])
async def get_playlists(
db: Session = Depends(get_db)
):
"""Get all playlists"""
playlists = get_all_playlists(db)
return playlists