u
This commit is contained in:
@@ -59,7 +59,7 @@ const category = await store.category.createUnderParent({ googleAuthId: 42, pare
|
||||
|
||||
*Source: `src/store/category/delete.js`*
|
||||
|
||||
Deletes a category, refusing to delete the company's root category.
|
||||
Deletes a category, refusing to delete the company's root category. If recursive is true, recursively deletes the subtree and articles that only belong to it.
|
||||
|
||||
**Parameters**
|
||||
|
||||
@@ -68,6 +68,7 @@ Deletes a category, refusing to delete the company's root category.
|
||||
| `input` | `object` | The delete input. |
|
||||
| `input.googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `input.id` | `number` | The id of the category to delete. |
|
||||
| `[input.recursive=false]` | `boolean` | Whether to delete the category subtree recursively. |
|
||||
| `[tx]` | `object` | Optional transaction to run within. |
|
||||
|
||||
**Returns**
|
||||
@@ -76,12 +77,13 @@ Deletes a category, refusing to delete the company's root category.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the category is the root category or contains articles/subcategories.
|
||||
`Error` — If the category is the root category or contains articles/subcategories (when recursive is false).
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
await store.category.delete({ googleAuthId: 42, id: 5 });
|
||||
await store.category.delete({ googleAuthId: 42, id: 5, recursive: true });
|
||||
```
|
||||
|
||||
## `category.deleteImage`
|
||||
|
||||
Reference in New Issue
Block a user