This commit is contained in:
seb
2026-07-31 07:42:19 +02:00
parent 39c5820947
commit 4f98082061
6 changed files with 70 additions and 0 deletions

View File

@@ -119,6 +119,11 @@ Backend mapping:
| `updateParentId` | `(id, parentId)` | `void` |
| `delete` | `(id)` | `void` — blocked by FK if `categoryarticle` (or child categories) still reference it |
| `getTree` | `(rootId)` | `{ id, parentId, sort }[]` |
| `getTreeForCompany` | `(authId, companyId)` | `{ id, parentId, sort }[]` — membership check + company root |
`getTreeForCompany` throws `Not authorized` if `authId` is not a `companyuser` of `companyId`, and `Company not found` if the company is missing or has no `root_category_id`. Reuses `GET_TREE` after access check.
`getTree(rootId)` stays for low-level use (tests, internal) when the root id is already known.
---
@@ -131,6 +136,7 @@ Backend mapping:
| `PATCH /api/company/:id` | `company.update(id, { iso639, name, taxrate, reducedtaxrate })` |
| `DELETE /api/company/:id` | `company.delete(id)` |
| `PUT /api/auth/selected-company` | `google_auth.setSelectedCompany(authId, companyId)` |
| `GET /api/category/tree?companyId=` | `category.getTreeForCompany(authId, companyId)` |
---