Fetch all legal forms and find the matching label for a pravnaForma code on an accounting unit.
Resolve a legal form code
Copy
Ask AI
// 1. Fetch all legal formsconst { klasifikacie } = await fetch(`${BASE}/api/pravne-formy`).then(r => r.json());// 2. Resolve the legal form label for an accounting unitconst form = klasifikacie.find(f => f.kod === unit.pravnaForma);// 3. Log the legal form labelconsole.log(form?.nazov?.sk);