We should change the implementation of the string fields that take in a type, to ensure that yup is able to validate the choices of the field properly. For example
recordServiceIncident: mixed<ServiceIncidentControlEnum>()
.required("Record Service Incident is required")
.oneOf(Object.values(ServiceIncidentControlEnum)),
One thing to note is that the API will take care of the validation as well ,but it is good to have some form of client validation as well.
We should change the implementation of the string fields that take in a type, to ensure that yup is able to validate the choices of the field properly. For example
This can be used in yup schemas as follows:
One thing to note is that the API will take care of the validation as well ,but it is good to have some form of client validation as well.