mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
update dashboard queries to use mv
This commit is contained in:
parent
5289c277fb
commit
bfd5c5f150
5 changed files with 44 additions and 12 deletions
|
|
@ -64,7 +64,7 @@ export default async (
|
|||
await useAuth(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { websiteId, type, limit, offset, search } = req.query;
|
||||
const { websiteId, type, limit, offset, search, unit } = req.query;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||
|
|
@ -89,7 +89,7 @@ export default async (
|
|||
}
|
||||
|
||||
if (SESSION_COLUMNS.includes(type)) {
|
||||
const data = await getSessionMetrics(websiteId, type, filters, limit, offset);
|
||||
const data = await getSessionMetrics(websiteId, type, filters, limit, offset, unit as string);
|
||||
|
||||
if (type === 'language') {
|
||||
const combined = {};
|
||||
|
|
@ -111,7 +111,14 @@ export default async (
|
|||
}
|
||||
|
||||
if (EVENT_COLUMNS.includes(type)) {
|
||||
const data = await getPageviewMetrics(websiteId, type, filters, limit, offset);
|
||||
const data = await getPageviewMetrics(
|
||||
websiteId,
|
||||
type,
|
||||
filters,
|
||||
limit,
|
||||
offset,
|
||||
unit as string,
|
||||
);
|
||||
|
||||
return ok(res, data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue