mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: remove parent item category from item categories service.
This commit is contained in:
@@ -99,9 +99,6 @@ export default class ItemCategoriesService implements IItemCategoriesService {
|
||||
if (itemCategoryOTD.inventoryAccountId) {
|
||||
await this.validateInventoryAccount(tenantId, itemCategoryOTD.inventoryAccountId);
|
||||
}
|
||||
if (itemCategoryOTD.parentCategoryId) {
|
||||
await this.getItemCategoryOrThrowError(tenantId, itemCategoryOTD.parentCategoryId);
|
||||
}
|
||||
|
||||
const itemCategoryObj = this.transformOTDToObject(itemCategoryOTD, authorizedUser);
|
||||
const itemCategory = await ItemCategory.query().insert({ ...itemCategoryObj });
|
||||
@@ -203,10 +200,6 @@ export default class ItemCategoriesService implements IItemCategoriesService {
|
||||
if (itemCategoryOTD.inventoryAccountId) {
|
||||
await this.validateInventoryAccount(tenantId, itemCategoryOTD.inventoryAccountId);
|
||||
}
|
||||
if (itemCategoryOTD.parentCategoryId) {
|
||||
await this.getItemCategoryOrThrowError(tenantId, itemCategoryOTD.parentCategoryId);
|
||||
}
|
||||
|
||||
const itemCategoryObj = this.transformOTDToObject(itemCategoryOTD, authorizedUser);
|
||||
const itemCategory = await ItemCategory.query().patchAndFetchById(itemCategoryId, { ...itemCategoryObj });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user