mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 17:45:38 +01:00
More yup validations.
This commit is contained in:
parent
2ccb8d0a3c
commit
ce2a83a09f
12 changed files with 99 additions and 50 deletions
|
|
@ -11,23 +11,36 @@ export interface WebsiteStatsRequestQuery {
|
|||
id: string;
|
||||
startAt: number;
|
||||
endAt: number;
|
||||
url: string;
|
||||
referrer: string;
|
||||
title: string;
|
||||
query: string;
|
||||
event: string;
|
||||
os: string;
|
||||
browser: string;
|
||||
device: string;
|
||||
country: string;
|
||||
region: string;
|
||||
city: string;
|
||||
url?: string;
|
||||
referrer?: string;
|
||||
title?: string;
|
||||
query?: string;
|
||||
event?: string;
|
||||
os?: string;
|
||||
browser?: string;
|
||||
device?: string;
|
||||
country?: string;
|
||||
region?: string;
|
||||
city?: string;
|
||||
}
|
||||
|
||||
import * as yup from 'yup';
|
||||
const schema = {
|
||||
GET: yup.object().shape({
|
||||
id: yup.string().uuid().required(),
|
||||
startAt: yup.number().required(),
|
||||
endAt: yup.number().required(),
|
||||
url: yup.string(),
|
||||
referrer: yup.string(),
|
||||
title: yup.string(),
|
||||
query: yup.string(),
|
||||
event: yup.string(),
|
||||
os: yup.string(),
|
||||
browser: yup.string(),
|
||||
device: yup.string(),
|
||||
country: yup.string(),
|
||||
region: yup.string(),
|
||||
city: yup.string(),
|
||||
}),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue