crappy
This commit is contained in:
21
routers/client.py
Normal file
21
routers/client.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from backend.session import get_session
|
||||
from schemas.client import ClientSearchRequest
|
||||
from services.client import ClientService
|
||||
|
||||
client_router = APIRouter(
|
||||
prefix="/client",
|
||||
tags=['client']
|
||||
)
|
||||
|
||||
|
||||
@client_router.get('/search', operation_id='search_clients')
|
||||
async def search_clients(
|
||||
name: str,
|
||||
session: Annotated[AsyncSession, Depends(get_session)]
|
||||
):
|
||||
return await ClientService(session).search_clients(ClientSearchRequest(name=name))
|
||||
Reference in New Issue
Block a user