mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: activate/inactivate item.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { difference } from "lodash";
|
||||
import { defaultTo, difference } from "lodash";
|
||||
import { Service, Inject } from "typedi";
|
||||
import { IItemsFilter, IItemsService, IItemDTO, IItem } from 'interfaces';
|
||||
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
||||
@@ -176,7 +176,10 @@ export default class ItemsService implements IItemsService {
|
||||
if (itemDTO.inventoryAccountId) {
|
||||
await this.validateItemInventoryAccountExistance(tenantId, itemDTO.inventoryAccountId);
|
||||
}
|
||||
const storedItem = await Item.query().insertAndFetch({ ...itemDTO });
|
||||
const storedItem = await Item.query().insertAndFetch({
|
||||
...itemDTO,
|
||||
active: defaultTo(itemDTO.active, 1),
|
||||
});
|
||||
this.logger.info('[items] item inserted successfully.', { tenantId, itemDTO });
|
||||
|
||||
return storedItem;
|
||||
|
||||
Reference in New Issue
Block a user