From f2f5654c0fe37d909b8ea39077d96ed98578761f Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Wed, 26 Mar 2025 06:58:51 -0500 Subject: [PATCH] Add Get endpoint for /music --- endpoints/music.get.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 endpoints/music.get.py diff --git a/endpoints/music.get.py b/endpoints/music.get.py new file mode 100644 index 0000000..d8ae646 --- /dev/null +++ b/endpoints/music.get.py @@ -0,0 +1,17 @@ +# Entity: Artist + +from fastapi import APIRouter, Depends, status +from sqlalchemy.orm import Session +from typing import List +from core.database import get_db +from core.models.artist import Artist +from core.schemas.artist import ArtistSchema + +router = APIRouter() + +@router.get("/music", status_code=200, response_model=List[ArtistSchema]) +async def get_artists_in_norway( + db: Session = Depends(get_db) +): + artists = db.query(Artist).filter(Artist.country == "Norway").all() + return artists \ No newline at end of file