19 lines
580 B
Python
19 lines
580 B
Python
|
from fastapi import APIRouter, Depends
|
||
|
|
||
|
from core.models.office.requests import UpdateOfficeRequest
|
||
|
from core.models.office.responses import JdeOfficeDetailResponse
|
||
|
from core.services.office import services
|
||
|
|
||
|
router = APIRouter(prefix='/offices')
|
||
|
|
||
|
|
||
|
@router.get('/offices')
|
||
|
async def list_offices(offices: list[JdeOfficeDetailResponse] = Depends(services.list_offices_service)) -> list[
|
||
|
JdeOfficeDetailResponse]:
|
||
|
return offices
|
||
|
|
||
|
|
||
|
@router.post('/offices')
|
||
|
async def update_office(data: UpdateOfficeRequest):
|
||
|
await services.update_office(data)
|