Files
kontor/kontor-api/src/apis/version1/bookshelf/articleauthor.py
T
Thomas Peetz 944420802f
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
added all missing endpoints
2026-05-20 14:08:10 +02:00

20 lines
629 B
Python

from typing import List
from fastapi import APIRouter
from src.db.models.bookshelf import ArticleAuthor
from src.db.session import SessionDep
from src.schema.bookshelf.articleauthor import ArticleAuthorResponse, to_response
router = APIRouter()
@router.get("/articleauthors", response_model=List[ArticleAuthorResponse])
def get_all_artists(db: SessionDep) -> List[ArticleAuthorResponse]:
results: List[ArticleAuthorResponse] = []
articleauthors = db.query(ArticleAuthor).all()
for articleauthor in articleauthors:
response = to_response(articleauthor)
results.append(response)
return results