d5705c3a28
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #98
20 lines
525 B
Python
20 lines
525 B
Python
from typing import List
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from src.db.models.admin import Token
|
|
from src.db.session import SessionDep
|
|
from src.schema.user.token import TokenResponse, to_response
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/tokens", response_model=List[TokenResponse])
|
|
def get_all_profiles(db: SessionDep) -> List[TokenResponse]:
|
|
results: List[TokenResponse] = []
|
|
tokens = db.query(Token).all()
|
|
for token in tokens:
|
|
response = to_response(token)
|
|
results.append(response)
|
|
return results
|