MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / _onRefreshData

Function _onRefreshData

client/src/containers/AddChart/AddChart.jsx:322–356  ·  view source on GitHub ↗
(filters = [])

Source from the content-addressed store, hash-verified

320 };
321
322 const _onRefreshData = (filters = []) => {
323 if (!params.chartId) return;
324
325 const getCache = useCache;
326
327 return dispatch(runQuery({
328 project_id: params.projectId,
329 chart_id: params.chartId,
330 noSource: false,
331 skipParsing: false,
332 filters,
333 getCache
334 }))
335 .then(() => {
336 if (conditions.length > 0) {
337 return dispatch(runQueryWithFilters({
338 project_id: params.projectId,
339 chart_id: newChart.id,
340 filters: conditions,
341 getCache: useCache,
342 }));
343 }
344
345 return true;
346 })
347 .then(() => {
348 setLoading(false);
349 })
350 .catch(() => {
351 toast.error("We couldn't fetch the data. Please check your dataset settings and try again", {
352 autoClose: 2500,
353 });
354 setLoading(false);
355 });
356 };
357
358 const _onRefreshPreview = (skipParsing = true, filters = []) => {
359 if (!params.chartId) return;

Callers 1

_onChangeChartFunction · 0.70

Calls 3

runQueryFunction · 0.90
runQueryWithFiltersFunction · 0.90
dispatchFunction · 0.50

Tested by

no test coverage detected