mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Fix insights validation.
This commit is contained in:
parent
d4be41a121
commit
9180a7008b
1 changed files with 14 additions and 3 deletions
|
|
@ -12,8 +12,8 @@ export interface InsightsRequestBody {
|
||||||
startDate: string;
|
startDate: string;
|
||||||
endDate: string;
|
endDate: string;
|
||||||
};
|
};
|
||||||
fields: { name: string; type: string; value: string }[];
|
fields: { name: string; type: string; label: string }[];
|
||||||
filters: string[];
|
filters: { name: string; type: string; filter: string; value: string }[];
|
||||||
groups: { name: string; type: string }[];
|
groups: { name: string; type: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,12 +33,23 @@ const schema = {
|
||||||
yup.object().shape({
|
yup.object().shape({
|
||||||
name: yup.string().required(),
|
name: yup.string().required(),
|
||||||
type: yup.string().required(),
|
type: yup.string().required(),
|
||||||
|
label: yup.string().required(),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.min(1)
|
||||||
|
.required(),
|
||||||
|
filters: yup
|
||||||
|
.array()
|
||||||
|
.of(
|
||||||
|
yup.object().shape({
|
||||||
|
name: yup.string().required(),
|
||||||
|
type: yup.string().required(),
|
||||||
|
filter: yup.string().required(),
|
||||||
value: yup.string().required(),
|
value: yup.string().required(),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.min(1)
|
.min(1)
|
||||||
.required(),
|
.required(),
|
||||||
filters: yup.array().of(yup.string()).min(1).required(),
|
|
||||||
groups: yup.array().of(
|
groups: yup.array().of(
|
||||||
yup.object().shape({
|
yup.object().shape({
|
||||||
name: yup.string().required(),
|
name: yup.string().required(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue