mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Added parseDateRangeQuery function.
This commit is contained in:
parent
a0aaeeeb57
commit
09af33c77e
15 changed files with 139 additions and 98 deletions
|
|
@ -5,6 +5,7 @@ import { canViewWebsite } from 'lib/auth';
|
|||
import { useAuth, useCors } from 'lib/middleware';
|
||||
import { SESSION_COLUMNS, EVENT_COLUMNS, FILTER_COLUMNS } from 'lib/constants';
|
||||
import { getPageviewMetrics, getSessionMetrics } from 'queries';
|
||||
import { parseDateRangeQuery } from 'lib/query';
|
||||
|
||||
export interface WebsiteMetricsRequestQuery {
|
||||
id: string;
|
||||
|
|
@ -34,8 +35,6 @@ export default async (
|
|||
const {
|
||||
id: websiteId,
|
||||
type,
|
||||
startAt,
|
||||
endAt,
|
||||
url,
|
||||
referrer,
|
||||
title,
|
||||
|
|
@ -54,8 +53,7 @@ export default async (
|
|||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const startDate = new Date(+startAt);
|
||||
const endDate = new Date(+endAt);
|
||||
const { startDate, endDate } = await parseDateRangeQuery(req);
|
||||
|
||||
if (SESSION_COLUMNS.includes(type)) {
|
||||
const column = FILTER_COLUMNS[type] || type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue