fix: add regex validation of membership no

This commit is contained in:
Arvid Norlin
2024-12-09 14:51:13 +01:00
parent d67a2919bf
commit e885b76a12

View File

@@ -42,10 +42,10 @@ export const notJoinDetailsSchema = baseDetailsSchema.merge(
}, "Only digits are allowed")
.refine((num) => {
if (num) {
return num.length === 14
return num.match(/^30812(?!(0|1|2))[0-9]{9}$/)
}
return true
}, "Membership number needs to be 14 digits"),
}, "Invalid membership number format"),
})
)