mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
Fixed query parameter filter.
This commit is contained in:
parent
358519dddd
commit
64b040c865
@ -190,8 +190,8 @@ function parseFilters(filters: any = {}, params: any = {}) {
|
||||
|
||||
async function rawQuery(query, params = {}) {
|
||||
if (process.env.LOG_QUERY) {
|
||||
log(query);
|
||||
log(params);
|
||||
log('QUERY:\n', query);
|
||||
log('PARAMETERS:\n', params);
|
||||
}
|
||||
|
||||
await connect();
|
||||
|
@ -50,7 +50,7 @@ export const percentFilter = data => {
|
||||
export const paramFilter = data => {
|
||||
const map = data.reduce((obj, { x, y }) => {
|
||||
try {
|
||||
const searchParams = new URLSearchParams(x.split('?')[1]);
|
||||
const searchParams = new URLSearchParams(x);
|
||||
|
||||
for (const [key, value] of searchParams) {
|
||||
if (!obj[key]) {
|
||||
|
@ -89,6 +89,7 @@ export default async (
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
city,
|
||||
query,
|
||||
} = req.query;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
@ -162,7 +163,7 @@ export default async (
|
||||
subdivision2: type !== 'subdivision2' ? subdivision2 : undefined,
|
||||
city: type !== 'city' ? city : undefined,
|
||||
eventUrl: type !== 'url' && table === 'event' ? url : undefined,
|
||||
query: type === 'query' && table !== 'event' ? true : undefined,
|
||||
query: type !== 'query' && table !== 'event' ? query : undefined,
|
||||
};
|
||||
|
||||
const data = await getPageviewMetrics(websiteId, {
|
||||
|
Loading…
Reference in New Issue
Block a user