fix: referrer with query strings wont be parsed
parent
d381560027
commit
be0c43dcaa
|
@ -64,9 +64,10 @@ export function getFilterQuery(table, filters = {}, params = []) {
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'url':
|
case 'url':
|
||||||
if (table === 'session' || table === 'pageview') {
|
if (table === 'session' || table === 'pageview' || table === 'event') {
|
||||||
arr.push(`and ${table}.${key}=$${params.length + 1}`);
|
arr.push(`and (${table}.${key}=$${params.length + 1} or ${table}.${key} like $${params.length + 2})`);
|
||||||
params.push(decodeURIComponent(value));
|
params.push(decodeURIComponent(value));
|
||||||
|
params.push(`${decodeURIComponent(value)}?%`);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -125,7 +126,7 @@ export function parseFilters(table, filters = {}, params = []) {
|
||||||
os || browser || device || country
|
os || browser || device || country
|
||||||
? `inner join session on ${table}.session_id = session.session_id`
|
? `inner join session on ${table}.session_id = session.session_id`
|
||||||
: '',
|
: '',
|
||||||
pageviewQuery: getFilterQuery('pageview', pageviewFilters, params),
|
pageviewQuery: table === 'event' ? getFilterQuery('event', pageviewFilters, params) : getFilterQuery('pageview', pageviewFilters, params),
|
||||||
sessionQuery: getFilterQuery('session', sessionFilters, params),
|
sessionQuery: getFilterQuery('session', sessionFilters, params),
|
||||||
eventQuery: getFilterQuery('event', eventFilters, params),
|
eventQuery: getFilterQuery('event', eventFilters, params),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue