mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +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 = {}) {
|
async function rawQuery(query, params = {}) {
|
||||||
if (process.env.LOG_QUERY) {
|
if (process.env.LOG_QUERY) {
|
||||||
log(query);
|
log('QUERY:\n', query);
|
||||||
log(params);
|
log('PARAMETERS:\n', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
await connect();
|
await connect();
|
||||||
|
@ -50,7 +50,7 @@ export const percentFilter = data => {
|
|||||||
export const paramFilter = data => {
|
export const paramFilter = data => {
|
||||||
const map = data.reduce((obj, { x, y }) => {
|
const map = data.reduce((obj, { x, y }) => {
|
||||||
try {
|
try {
|
||||||
const searchParams = new URLSearchParams(x.split('?')[1]);
|
const searchParams = new URLSearchParams(x);
|
||||||
|
|
||||||
for (const [key, value] of searchParams) {
|
for (const [key, value] of searchParams) {
|
||||||
if (!obj[key]) {
|
if (!obj[key]) {
|
||||||
|
@ -89,6 +89,7 @@ export default async (
|
|||||||
subdivision1,
|
subdivision1,
|
||||||
subdivision2,
|
subdivision2,
|
||||||
city,
|
city,
|
||||||
|
query,
|
||||||
} = req.query;
|
} = req.query;
|
||||||
|
|
||||||
if (req.method === 'GET') {
|
if (req.method === 'GET') {
|
||||||
@ -162,7 +163,7 @@ export default async (
|
|||||||
subdivision2: type !== 'subdivision2' ? subdivision2 : undefined,
|
subdivision2: type !== 'subdivision2' ? subdivision2 : undefined,
|
||||||
city: type !== 'city' ? city : undefined,
|
city: type !== 'city' ? city : undefined,
|
||||||
eventUrl: type !== 'url' && table === 'event' ? url : 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, {
|
const data = await getPageviewMetrics(websiteId, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user