mirror of
https://github.com/Xevion/bus-reminder.git
synced 2025-12-18 10:11:25 -06:00
Use transform instead of preprocess of days array to set in config schema
This commit is contained in:
@@ -45,10 +45,9 @@ const TimeConfigSchema = z.object({
|
||||
return parsed;
|
||||
}),
|
||||
// The days this configuration is active on.
|
||||
days: z.preprocess((v) => {
|
||||
const parsedArray = z.any().array().parse(v);
|
||||
return new Set(parsedArray);
|
||||
}, z.set(DayEnumSchema).nonempty()),
|
||||
days: z.array(DayEnumSchema).nonempty().transform(arr => {
|
||||
return new Set<DayEnum>(arr);
|
||||
}),
|
||||
// If a notification isn't delivery within 10 minutes e.g. "00:30", 24 hour time
|
||||
maxLate: z
|
||||
.string()
|
||||
|
||||
Reference in New Issue
Block a user