Add GET endpoint for /lol2
This commit is contained in:
parent
443dc8623c
commit
028c27e16d
18
endpoints/lol2.get.py
Normal file
18
endpoints/lol2.get.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Entity: Soap
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
from typing import List
|
||||
from core.database import get_db
|
||||
from models.soap import Soap
|
||||
from schemas.soap import SoapSchema
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/lol2", status_code=200, response_model=List[SoapSchema])
|
||||
async def get_soaps(
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""Get all soaps"""
|
||||
soaps = db.query(Soap).all()
|
||||
return soaps
|
Loading…
x
Reference in New Issue
Block a user