mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat(branche & warehouse ) add mark primary alert.
This commit is contained in:
@@ -113,3 +113,21 @@ export function useActivateBranches(props) {
|
||||
...props,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark primary the given branch.
|
||||
*/
|
||||
export function useMarkPrimaryBranches(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation((id) => apiRequest.post(`branches/${id}/mark-primary`), {
|
||||
onSuccess: (res, id) => {
|
||||
// Invalidate specific inventory adjustment.
|
||||
queryClient.invalidateQueries([t.BRANCH, id]);
|
||||
|
||||
commonInvalidateQueries(queryClient);
|
||||
},
|
||||
...props,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -233,3 +233,21 @@ export function useActivateWarehouses(props) {
|
||||
...props,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark primary the given branch.
|
||||
*/
|
||||
export function useMarkPrimaryWarehouse(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation((id) => apiRequest.post(`warehouses/${id}/mark-primary`), {
|
||||
onSuccess: (res, id) => {
|
||||
// Invalidate specific inventory adjustment.
|
||||
queryClient.invalidateQueries([t.WAREHOUSE, id]);
|
||||
|
||||
commonInvalidateQueries(queryClient);
|
||||
},
|
||||
...props,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user