mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: Inventory adjustment publish.
This commit is contained in:
@@ -84,3 +84,24 @@ export function useInventoryAdjustments(query, props) {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publishes the given inventory adjustment.
|
||||
*/
|
||||
export function usePublishInventoryAdjustment(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation(
|
||||
(id) => apiRequest.post(`inventory_adjustments/${id}/publish`),
|
||||
{
|
||||
onSuccess: (res, id) => {
|
||||
// Invalidate specific inventory adjustment.
|
||||
queryClient.invalidateQueries([t.INVENTORY_ADJUSTMENT, id]);
|
||||
|
||||
commonInvalidateQueries(queryClient);
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ const SALE_RECEIPTS = {
|
||||
|
||||
const INVENTORY_ADJUSTMENTS = {
|
||||
INVENTORY_ADJUSTMENTS: 'INVENTORY_ADJUSTMENTS',
|
||||
INVENTORY_ADJUSTMENT: 'INVENTORY_ADJUSTMENT',
|
||||
};
|
||||
|
||||
const CURRENCIES = {
|
||||
|
||||
Reference in New Issue
Block a user