'use strict';

var reactQuery = require('@tanstack/react-query');
var v2_reactUtils_useMutationWithInvalidation_useMutationWithInvalidation = require('../useMutationWithInvalidation/useMutationWithInvalidation.js');
var v2_reactUtils_useColumnConfig_api = require('./api.js');
var v2_reactUtils_useColumnConfig_constants = require('./constants.js');
require('../../../defineProperty-lChFfVqi.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: [v2_reactUtils_useColumnConfig_constants.TABLE_CONFIGURATION_QUERY_KEY, tableKey],
    enabled: !!tableKey,
    queryFn: function queryFn() {
      return v2_reactUtils_useColumnConfig_api.fetch(tableKey);
    }
  });
};
var useUpdateConfig = function useUpdateConfig(_ref2) {
  var tableKey = _ref2.tableKey;
  return v2_reactUtils_useMutationWithInvalidation_useMutationWithInvalidation(v2_reactUtils_useColumnConfig_api.update, {
    keysToInvalidate: [[v2_reactUtils_useColumnConfig_constants.TABLE_CONFIGURATION_QUERY_KEY, tableKey]]
  });
};

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