fix some components in realtime data

This commit is contained in:
Francis Cao 2023-04-06 18:31:16 -07:00
parent 6dd90ce9ca
commit 05ece6a4d0
6 changed files with 21 additions and 67 deletions

View file

@ -1,13 +1,13 @@
import { md5 } from 'lib/crypto';
import { getPageviews } from '../pageview/getPageviews';
import { getSessions } from '../session/getSessions';
import { getEvents } from '../event/getEvents';
import { EVENT_TYPE } from 'lib/constants';
export async function getRealtimeData(websiteId, time) {
const [pageviews, sessions, events] = await Promise.all([
getPageviews(websiteId, time),
getEvents(websiteId, time, EVENT_TYPE.pageView),
getSessions(websiteId, time),
getEvents(websiteId, time),
getEvents(websiteId, time, EVENT_TYPE.customEvent),
]);
const decorate = (id, data) => {