From bf61e77db3cf28713bff0168ff39b6f1551c8d7e Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 21:23:27 +0000 Subject: [PATCH] Add GET endpoint for /glory --- endpoints/glory.get.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/endpoints/glory.get.py b/endpoints/glory.get.py index e69de29..0eb670b 100644 --- a/endpoints/glory.get.py +++ b/endpoints/glory.get.py @@ -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 +``` \ No newline at end of file