Update code in endpoints/peoples1.get.py

This commit is contained in:
Backend IM Bot 2025-03-28 03:26:39 +01:00
parent 36948f3205
commit 9d16e431fb

18
endpoints/peoples1.get.py Normal file
View File

@ -0,0 +1,18 @@
# Entity: People
from fastapi import APIRouter, Depends, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from models.people import People
from schemas.people import PeopleSchema
from helpers.people_helpers import get_all_peoples
router = APIRouter()
@router.get("/peoples1", status_code=200, response_model=List[PeopleSchema])
async def get_peoples(
db: Session = Depends(get_db)
):
peoples = get_all_peoples(db)
return peoples