(filters = [])
| 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; |
no test coverage detected