18 lines
506 B
Python
18 lines
506 B
Python
from fastapi import APIRouter, Depends, HTTPException
|
|
from sqlalchemy.orm import Session
|
|
from typing import List
|
|
from database import get_db
|
|
from models import Specialty
|
|
from security import get_current_active_user
|
|
import schemas
|
|
|
|
router = APIRouter(
|
|
prefix="/specialties",
|
|
tags=["Specialties"],
|
|
dependencies=[Depends(get_current_active_user)]
|
|
)
|
|
|
|
@router.get("/", response_model=List[schemas.Specialty])
|
|
def read_specialties(db: Session = Depends(get_db)):
|
|
return db.query(Specialty).all()
|