Make interval in rrule config required (#220003)

Fixes the optional interval settings in the rrule schema
This commit is contained in:
Ersin Erdal 2025-05-03 00:56:00 +02:00 committed by GitHub
parent 59aa8f2f93
commit c51c0ce212
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,27 +37,23 @@ const validateRecurrenceByWeekday = (array: string[]) => {
};
const rruleCommon = schema.object({
freq: schema.maybe(
schema.oneOf([
schema.literal(0),
schema.literal(1),
schema.literal(2),
schema.literal(3),
schema.literal(4),
schema.literal(5),
schema.literal(6),
])
),
interval: schema.maybe(
schema.number({
validate: (interval: number) => {
if (!Number.isInteger(interval)) {
return 'rRule interval must be an integer greater than 0';
}
},
min: 1,
})
),
freq: schema.oneOf([
schema.literal(0),
schema.literal(1),
schema.literal(2),
schema.literal(3),
schema.literal(4),
schema.literal(5),
schema.literal(6),
]),
interval: schema.number({
validate: (interval: number) => {
if (!Number.isInteger(interval)) {
return 'rRule interval must be an integer greater than 0';
}
},
min: 1,
}),
tzid: schema.string({ validate: validateTimezone, defaultValue: 'UTC' }),
});