'use strict';

var reactQuery = require('@tanstack/react-query');
var reactUtils_useMutationWithInvalidation_useMutationWithInvalidation = require('../useMutationWithInvalidation/useMutationWithInvalidation.js');
var reactUtils_useColumnConfig_api = require('./api.js');
var reactUtils_useColumnConfig_constants = require('./constants.js');
require('../../defineProperty-COGyJ6Og.js');
require('../../toPropertyKey-DW-YC76_.js');
require('../../typeof-D4ZZ_FlZ.js');
require('../../objectWithoutProperties-wSsbHFcG.js');
require('ramda');
require('axios');

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

exports.useFetchConfig = useFetchConfig;
exports.useUpdateConfig = useUpdateConfig;
//# sourceMappingURL=useConfigApi.js.map
