const controller = new AbortController();
fetch('/api/demo/companies?country=SI&q=Pr', {
signal: controller.signal
}).then(response => {
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response.json();
});
POST /api/auth/loginGET /api/auth/mefetch('/api/companies?country=SI&q=Pr', {
headers: { Authorization: `Bearer ${accessToken}` },
signal: controller.signal
});
·
GET /api/companies?country=SI&q=Pr[
{
"country": "SI",
"sourceId": "demo-si",
"name": "Primer podjetja d.o.o.",
"taxNumber": "",
"registrationNumber": "",
"address": "Vzorčna ulica 1",
"postalCode": "1000",
"city": "Ljubljana",
"activity": "",
"source": "DEMO",
"updatedAt": "1970-01-01T00:00:00+00:00",
"originalAddress": ""
}
]
{
"type": "https://www.rfc-editor.org/rfc/rfc9110#section-15.5",
"title": "Invalid request",
"status": 400,
"detail": "Check the information you entered.",
"instance": "/api/auth/register",
"code": "validationError",
"traceId": "example-trace-id",
"errors": {
"email": ["Enter a valid email, at most 254 characters."],
"password": ["Use 12–128 password characters."]
}
}