Fixing the CACHING (#2203)

Caching wasn't working after deprecate_v1, this addresses it. Also surfacing
whether the data is served from cache in explore view and a way to force
run the query bypassing the cache.
This commit is contained in:
Maxime Beauchemin
2017-02-22 08:31:31 -08:00
committed by GitHub
parent ce1e18b31b
commit d5ba88b407
8 changed files with 39 additions and 14 deletions

View File

@@ -1,8 +1,14 @@
/* eslint camelcase: 0 */
export function getExploreUrl(form_data, dummy, endpoint = 'base') {
export function getExploreUrl(form_data, endpoint = 'base', force = false) {
if (!form_data.datasource) {
return null;
}
const [datasource_id, datasource_type] = form_data.datasource.split('__');
let params = `${datasource_type}/${datasource_id}/`;
params += '?form_data=' + encodeURIComponent(JSON.stringify(form_data));
if (force) {
params += '&force=true';
}
switch (endpoint) {
case 'base':
return `/superset/explore/${params}`;