jde-server/core/services/office/helpers.py

9 lines
303 B
Python

import httpx
from core.models.office.db import JdeOfficeDB
async def grab_data() -> list[JdeOfficeDB]:
async with httpx.AsyncClient() as client:
response = await client.get('http://localhost/api/v1/vD/geo/search?mode=2')
return [JdeOfficeDB.model_validate(x) for x in response.json()]