mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: inventory adjustment detail.
This commit is contained in:
@@ -7,6 +7,7 @@ import t from './types';
|
||||
const commonInvalidateQueries = (queryClient) => {
|
||||
// Invalidate inventory adjustments.
|
||||
queryClient.invalidateQueries(t.INVENTORY_ADJUSTMENTS);
|
||||
queryClient.invalidateQueries(t.INVENTORY_ADJUSTMENT);
|
||||
|
||||
// Invalidate items.
|
||||
queryClient.invalidateQueries(t.ITEMS);
|
||||
@@ -105,3 +106,19 @@ export function usePublishInventoryAdjustment(props) {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the inventory adjustment details.
|
||||
* @param {number} id - inventory adjustment id.
|
||||
*/
|
||||
export function useInventoryAdjustment(id, props, requestProps) {
|
||||
return useRequestQuery(
|
||||
[t.INVENTORY_ADJUSTMENT, id],
|
||||
{ method: 'get', url: `inventory_adjustments/${id}`, ...requestProps },
|
||||
{
|
||||
select: (res) => res.data.data,
|
||||
defaultData: {},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user