import { useQuery } from '@tanstack/react-query';
import useMutationWithInvalidation from '../useMutationWithInvalidation/useMutationWithInvalidation.js';
import configApi from './api.js';
import { TABLE_CONFIGURATION_QUERY_KEY } from './constants.js';
import '../../../defineProperty-Dcer7TUY.js';
import '../../../toPropertyKey-BAXkSB3z.js';
import '../../../typeof-D-UKOauR.js';
import '../../../objectWithoutProperties-DN7d1SzH.js';
import 'ramda';
import 'axios';

var useFetchConfig = function useFetchConfig(_ref) {
  var tableKey = _ref.tableKey;
  return useQuery({
    queryKey: [TABLE_CONFIGURATION_QUERY_KEY, tableKey],
    enabled: !!tableKey,
    queryFn: function queryFn() {
      return configApi.fetch(tableKey);
    }
  });
};
var useUpdateConfig = function useUpdateConfig(_ref2) {
  var tableKey = _ref2.tableKey;
  return useMutationWithInvalidation(configApi.update, {
    keysToInvalidate: [[TABLE_CONFIGURATION_QUERY_KEY, tableKey]]
  });
};

export { useFetchConfig, useUpdateConfig };
//# sourceMappingURL=useConfigApi.js.map
