feat(item): add item warehouse locations.

This commit is contained in:
elforjani13
2022-02-14 09:32:31 +02:00
parent 005cb4344d
commit 9f466ba4df
6 changed files with 55 additions and 14 deletions

View File

@@ -231,3 +231,18 @@ export function useItemAssociatedBillTransactions(id, props) {
},
);
}
export function useItemWarehouseLocation(id, props) {
return useRequestQuery(
[t.ITEM_WAREHOUSES_LOCATION, id],
{
method: 'get',
url: `items/${id}/warehouses`,
},
{
select: (res) => res.data.item_warehouses,
defaultData: [],
...props,
},
);
}

View File

@@ -53,6 +53,7 @@ const ITEMS = {
ITEM_ASSOCIATED_WITH_ESTIMATES: 'ITEM_ASSOCIATED_WITH_ESTIMATES',
ITEM_ASSOCIATED_WITH_RECEIPTS: 'ITEM_ASSOCIATED_WITH_RECEIPTS',
ITEMS_ASSOCIATED_WITH_BILLS: 'ITEMS_ASSOCIATED_WITH_BILLS',
ITEM_WAREHOUSES_LOCATION: 'ITEM_WAREHOUSES_LOCATION',
};
const SALE_ESTIMATES = {