mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Update compare parameter to use enum for valid values
This commit is contained in:
parent
6420f2c813
commit
a049fbb5b0
2 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ export async function GET(
|
|||
|
||||
const data = await getWebsiteStats(websiteId, filters);
|
||||
|
||||
const compare = filters.compare === 'yoy' ? 'yoy' : 'prev';
|
||||
const compare = filters.compare ?? 'prev';
|
||||
|
||||
const { startDate, endDate } = getCompareDate(compare, filters.startDate, filters.endDate);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export const dateRangeParams = {
|
|||
endDate: z.coerce.date().optional(),
|
||||
timezone: timezoneParam.optional(),
|
||||
unit: unitParam.optional(),
|
||||
compare: z.string().optional(),
|
||||
compare: z.enum(['prev', 'yoy']).optional(),
|
||||
};
|
||||
|
||||
export const filterParams = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue