u
This commit is contained in:
@@ -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)` |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user