mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Moved code into src folder. Added build for component library.
This commit is contained in:
parent
7a7233ead4
commit
ede658771e
490 changed files with 749 additions and 442 deletions
19
src/lib/yup.ts
Normal file
19
src/lib/yup.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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(),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue