Spaces:
Running
on
Zero
Running
on
Zero
from fastapi import APIRouter, Depends | |
from fastapi.responses import JSONResponse | |
from fastapi.requests import Request | |
from fastapi.encoders import jsonable_encoder | |
from app.crud.team import create_team, get_teams | |
from app.schema.team import TeamSchema | |
from app.main import get_db | |
router = APIRouter() | |
async def create_team_endpoint(team: TeamSchema, db: Session = Depends(get_db)): | |
return create_team(db, team) | |
async def get_teams_endpoint(db: Session = Depends(get_db)): | |
return get_teams(db) |