Enforce integer validation on age and average time fields

Added integer validation messages to the age and avg_time fields to ensure users enter whole numbers. This enhances the form's data integrity by preventing input errors.
This commit is contained in:
Teriuihi 2024-08-10 04:35:54 +02:00
parent afb833bd19
commit cf7bdeb481

View File

@ -163,6 +163,7 @@ export const apply: FormData = {
age: Yup.number()
.typeError('Input must be a number')
.integer('Please enter a whole number')
.min(0, 'Please enter a valid age')
.max(999, 'We do not accept players older than 999 years old sorry!')
.required('You are required to fill out your age'),
@ -175,6 +176,7 @@ export const apply: FormData = {
avg_time: Yup.number()
.typeError('Please enter a number')
.integer('Please enter a whole number')
.min(0, 'Please enter a positive number')
.max(168, 'There are only 168 hours in a week')
.required('Please enter the average time you will be available each week'),