Skip to content

Commit f507651

Browse files
committed
decode parameters
1 parent 0effaac commit f507651

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

data-table/public/js/main.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async function runQueryByID(query) {
8888
{query, queryParams}
8989
);
9090
setQueryResult(JSON.parse(result.response));
91-
} catch (e) {
91+
} catch(e) {
9292
handleError(e);
9393
}
9494

@@ -106,12 +106,13 @@ function parseQueryParams() {
106106
const parameter = getParameter(item);
107107
if (parameter) {
108108
if (parameter.type === 'global') {
109-
result.global[parameter.key] = decodeURIComponent(parameter.value);
109+
result.global[decodeURIComponent(parameter.key)] = decodeURIComponent(parameter.value);
110110
} else if (parameter.type === 'templateField') {
111-
result.templateFields[parameter.key] = decodeURIComponent(parameter.value);
111+
result.templateFields[decodeURIComponent(parameter.key)] = decodeURIComponent(parameter.value);
112112
}
113113
}
114114
});
115+
console.log(result);
115116
queryParams = result;
116117
}
117118

@@ -190,7 +191,7 @@ async function getSchema() {
190191
null
191192
);
192193
setSchema(JSON.parse(result.response));
193-
} catch (e) {
194+
} catch(e) {
194195
handleError(e);
195196
}
196197

@@ -205,7 +206,7 @@ async function validatePluginConfiguration() {
205206
);
206207
pluginConfiguration = JSON.parse(result.response);
207208
return true;
208-
} catch (e) {
209+
} catch(e) {
209210
handleError(e);
210211
}
211212
}
@@ -521,7 +522,7 @@ async function getQuery() {
521522
sourceKey: queryParams.global.sourceKey
522523
}
523524
);
524-
} catch (e) {
525+
} catch(e) {
525526
handleError(e);
526527
}
527528
}
@@ -539,7 +540,7 @@ async function main() {
539540
await runQueryByID(query);
540541
fillDataTable();
541542
}
542-
} catch (e) {
543+
} catch(e) {
543544
handleError(e);
544545
}
545546

0 commit comments

Comments
 (0)