Fix insights validation.
This commit is contained in:
@@ -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(),
|
||||||
|
|||||||
Reference in New Issue
Block a user