mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
Use a key-value store model for sharing long queries (#1951)
* Add KeyValue model for storing id-value pairs use it for storing shared queries * Change string to text and added test * Put getQueryLink in one place * Changed migration down version * Changes based on comments * Update bcf3126872fc_add_keyvalue.py
This commit is contained in:
@@ -39,8 +39,20 @@ export function getParamFromQuery(query, param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
export function getLink(baseUrl, params) {
|
||||
return baseUrl + '?' + params.join('&');
|
||||
export function storeQuery(query, callback) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/kv/store/',
|
||||
async: false,
|
||||
data: {
|
||||
data: JSON.stringify(query),
|
||||
},
|
||||
success: (data) => {
|
||||
const baseUrl = window.location.origin + window.location.pathname;
|
||||
const url = `${baseUrl}?id=${JSON.parse(data).id}`;
|
||||
callback(url);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function getParamsFromUrl() {
|
||||
|
||||
Reference in New Issue
Block a user