add event_data to goal.

This commit is contained in:
Brian Cao committed 2024-05-20 21:10:46 -07:00
1 parent 76cab03bb2
commit 79a93ed9fc
7 files changed
+231 -48

No files matched your search

+15 -1
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)