add event_data to goal.

This commit is contained in:
Brian Cao 2024-05-20 21:10:46 -07:00
parent 76cab03bb2
commit 79a93ed9fc
7 changed files with 231 additions and 48 deletions

View file

@ -28,9 +28,23 @@ const schema = {
.array()
.of(
yup.object().shape({
type: yup.string().required(),
type: yup
.string()
.matches(/url|event|event-data/i)
.required(),
value: yup.string().required(),
goal: yup.number().required(),
operator: yup
.string()
.matches(/count|sum|average/i)
.when('type', {
is: 'eventData',
then: yup.string().required(),
}),
property: yup.string().when('type', {
is: 'eventData',
then: yup.string().required(),
}),
}),
)
.min(1)