mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Upgrade prisma. Lint fixes.
This commit is contained in:
parent
a3b5f05a32
commit
a224a3caf3
11 changed files with 56 additions and 51 deletions
|
|
@ -2,15 +2,15 @@ import { md5 } from 'next-basics';
|
|||
import { getSessions, getEvents } from 'queries/index';
|
||||
import { EVENT_TYPE } from 'lib/constants';
|
||||
|
||||
export async function getRealtimeData(websiteId, time) {
|
||||
export async function getRealtimeData(websiteId: string, startDate: Date) {
|
||||
const [pageviews, sessions, events] = await Promise.all([
|
||||
getEvents(websiteId, time, EVENT_TYPE.pageView),
|
||||
getSessions(websiteId, time),
|
||||
getEvents(websiteId, time, EVENT_TYPE.customEvent),
|
||||
getEvents(websiteId, startDate, EVENT_TYPE.pageView),
|
||||
getSessions(websiteId, startDate),
|
||||
getEvents(websiteId, startDate, EVENT_TYPE.customEvent),
|
||||
]);
|
||||
|
||||
const decorate = (id, data) => {
|
||||
return data.map(props => ({
|
||||
const decorate = (id: string, data: any[]) => {
|
||||
return data.map((props: { [key: string]: any }) => ({
|
||||
...props,
|
||||
__id: md5(id, ...Object.values(props)),
|
||||
__type: id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue