Add GET endpoint for /glory

This commit is contained in:
Backend IM Bot 2025-03-27 21:23:27 +00:00
parent 62ce111566
commit bf61e77db3

View File

@ -0,0 +1,21 @@
# Entity: Glory
```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.glory import Glory
from schemas.glory import GlorySchema
from helpers.glory_helpers import get_all_glory_records
router = APIRouter()
@router.get("/glory", response_model=List[GlorySchema], status_code=200)
async def get_glory_records(
db: Session = Depends(get_db)
):
"""Get all glory records"""
glory_records = get_all_glory_records(db)
return glory_records
```