u
This commit is contained in:
13
README.md
13
README.md
@@ -135,6 +135,18 @@ Backend mapping:
|
||||
|
||||
---
|
||||
|
||||
## `article`
|
||||
|
||||
| Method | Signature | Returns |
|
||||
| --- | --- | --- |
|
||||
| `createUnderParent` | `({ googleAuthId, parentId, name })` | `{ id, parentId, name, sku }` |
|
||||
|
||||
`parentId` is the category id. Creates `article` + `articletext` (company default language) + `categoryarticle` in one transaction. Allocates `sku` via `getnextnumberwithprefixandpadding` (`type` `sku`; creates `numbers` row with empty prefix if missing). Default unit `pc` is ensured if missing (`unitamount` 1, `weight` 0).
|
||||
|
||||
Auth via `resolveCategoryAccess(googleAuthId, parentId)` — `Parent not found` / `Not authorized`.
|
||||
|
||||
---
|
||||
|
||||
## Backend route cheatsheet
|
||||
|
||||
| Route | Store call |
|
||||
@@ -147,6 +159,7 @@ Backend mapping:
|
||||
| `GET /api/category/tree?companyId=` | `category.getTreeForCompany(googleAuthId, companyId)` |
|
||||
| `POST /api/category` | `category.createUnderParent({ googleAuthId, parentId, name })` |
|
||||
| `DELETE /api/category/:id` | `category.delete({ googleAuthId, id })` |
|
||||
| `POST /api/article` | `article.createUnderParent({ googleAuthId, parentId, name })` |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user