mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
19 lines
524 B
TypeScript
19 lines
524 B
TypeScript
import * as yup from 'yup';
|
|
|
|
export function getDateRangeValidation() {
|
|
return {
|
|
startAt: yup.number().integer().required(),
|
|
endAt: yup.number().integer().moreThan(yup.ref('startAt')).required(),
|
|
};
|
|
}
|
|
|
|
// ex: /funnel|insights|retention/i
|
|
export function getFilterValidation(matchRegex) {
|
|
return {
|
|
filter: yup.string(),
|
|
filterType: yup.string().matches(matchRegex),
|
|
pageSize: yup.number().integer().positive().max(200),
|
|
page: yup.number().integer().positive(),
|
|
orderBy: yup.string(),
|
|
};
|
|
}
|