mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Remove redundant compare param definition
This commit is contained in:
parent
fbf03d6563
commit
6420f2c813
1 changed files with 3 additions and 6 deletions
|
|
@ -12,7 +12,6 @@ export async function GET(
|
||||||
) {
|
) {
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
...dateRangeParams,
|
...dateRangeParams,
|
||||||
compare: z.enum(['prev', 'yoy']).optional(),
|
|
||||||
...filterParams,
|
...filterParams,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -32,11 +31,9 @@ export async function GET(
|
||||||
|
|
||||||
const data = await getWebsiteStats(websiteId, filters);
|
const data = await getWebsiteStats(websiteId, filters);
|
||||||
|
|
||||||
const { startDate, endDate } = getCompareDate(
|
const compare = filters.compare === 'yoy' ? 'yoy' : 'prev';
|
||||||
filters.compare || 'prev',
|
|
||||||
filters.startDate,
|
const { startDate, endDate } = getCompareDate(compare, filters.startDate, filters.endDate);
|
||||||
filters.endDate,
|
|
||||||
);
|
|
||||||
|
|
||||||
const comparison = await getWebsiteStats(websiteId, {
|
const comparison = await getWebsiteStats(websiteId, {
|
||||||
...filters,
|
...filters,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue