Add GET endpoint for interns

This commit is contained in:
Backend IM Bot 2025-03-26 13:53:43 +01:00
parent a1c0b7bee4
commit dfa838ce87

View File

@ -1,11 +1,12 @@
# Entity: Intern
from fastapi import APIRouter, Depends, status
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from core.models.intern import Intern
from core.schemas.intern import InternSchema
from models.intern import Intern
from schemas.intern import InternSchema
from helpers.intern_helpers import get_all_interns
router = APIRouter()
@ -13,5 +14,5 @@ router = APIRouter()
async def get_interns(
db: Session = Depends(get_db)
):
interns = db.query(Intern).all()
interns = get_all_interns(db)
return interns