Add category.move to reparent a category.

Validates both source and target via resolveCategoryAccess so the new
parent must be a category of the same authorized company, and guards
against moving into a descendant (cycle). Assigns next sibling sort.
This commit is contained in:
seb
2026-08-03 03:01:02 +02:00
parent b070607357
commit d8d66ce105
5 changed files with 114 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import categoryGetTreeForCompany from './store/category/getTreeForCompany.js';
import categoryGetCategoryArticles from './store/category/getCategoryArticles.js';
import categoryCreateUnderParent from './store/category/createUnderParent.js';
import categoryRename from './store/category/rename.js';
import categoryMove from './store/category/move.js';
import categoryOrder from './store/category/order.js';
import categoryDelete from './store/category/delete.js';
import articleDelete from './store/article/delete.js';
@@ -74,6 +75,7 @@ export default class LibDashStore {
getCategoryArticles: categoryGetCategoryArticles(pool),
createUnderParent: categoryCreateUnderParent(pool),
rename: categoryRename(pool),
move: categoryMove(pool),
order: categoryOrder(pool),
delete: categoryDelete(pool),
};