mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Cherry pick prisma query protection.
This commit is contained in:
parent
4c202741c2
commit
9a7385e4d5
9 changed files with 68 additions and 47 deletions
|
|
@ -45,8 +45,8 @@ async function relationalQuery(
|
|||
};
|
||||
},
|
||||
) {
|
||||
const { rawQuery, getDateQuery, getFilterQuery } = prisma;
|
||||
const params = [startDate, endDate];
|
||||
const { toUuid, rawQuery, getDateQuery, getFilterQuery } = prisma;
|
||||
const params: any = [websiteId, startDate, endDate];
|
||||
|
||||
return rawQuery(
|
||||
`select
|
||||
|
|
@ -54,8 +54,8 @@ async function relationalQuery(
|
|||
${getDateQuery('created_at', unit, timezone)} t,
|
||||
count(*) y
|
||||
from website_event
|
||||
where website_id='${websiteId}'
|
||||
and created_at between $1 and $2
|
||||
where website_id = $1${toUuid()}
|
||||
and created_at between $2 and $3
|
||||
and event_type = ${EVENT_TYPE.customEvent}
|
||||
${getFilterQuery(filters, params)}
|
||||
group by 1, 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue