fix(ReactQuery): add organization id in query keys.

This commit is contained in:
a.bouhuolia
2021-03-15 11:55:38 +02:00
parent 2e3fd64e2b
commit f1cf02c9df
27 changed files with 140 additions and 76 deletions

View File

@@ -1,4 +1,5 @@
import { useMutation, useQuery, useQueryClient } from 'react-query';
import { useMutation, useQueryClient } from 'react-query';
import { useQueryTenant } from '../useQueryTenant';
import { transformPagination } from 'utils';
import useApiRequest from '../useRequest';
import t from './types';
@@ -71,7 +72,7 @@ const inventoryAdjustmentsTransformer = (response) => {
export function useInventoryAdjustments(query, props) {
const apiRequest = useApiRequest();
return useQuery(
return useQueryTenant(
['INVENTORY_ADJUSTMENTS', query],
() => apiRequest.get('inventory_adjustments', { params: query })
.then(inventoryAdjustmentsTransformer),