Commit 2a412375 authored by Michael Auer's avatar Michael Auer
Browse files

improved console output limiting length of stings in query object

parent 3c5f67ba
......@@ -374,16 +374,17 @@ class Ohsome2X {
format: format
}
// removes properties with null or undefined
dataObject = Object.entries(dataObject).reduce((a,[k,v]) => (v == null ? a : {...a, [k]:v}), {});
const cleanDataObject: {[p: string]: string} = Object.entries(dataObject).reduce((a,[k,v]) => (v == null ? a : {...a, [k]:v}), {});
let dataString = querystring.stringify(dataObject);
let dataString = querystring.stringify(cleanDataObject);
// always make a group by boundary query for backward compatibility
// complete ohsomeAPI resource path should be used
let queryType = ohsomeQuery.queryType.replace(/(.*)(\/)?(\/groupBy\/boundary)(\/)?/, "$1");
console.log(`Querying ohsome-API: ${this.ohsomeApiUrl}/${queryType}/groupBy/boundary`);
console.log('with params:', dataObject);
console.log('with params:', Object.entries(cleanDataObject).reduce((a,[k,v])=>({...a, [k]: (typeof v =='string')?v.substring(0,200): v }),{}));
const stats = await axios(<AxiosRequestConfig>{
url: `${this.ohsomeApiUrl}/${queryType}/groupBy/boundary`,
method: 'post',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment