adrianhajdin / healthcare

Build a healthcare platform that streamlines patient registration, appointment scheduling, and medical records, and learn to implement complex forms and SMS notifications.
https://jsmastery.pro
1.81k stars 432 forks source link

Says attribute "gender" has invalid format #13

Closed aarxa closed 2 months ago

aarxa commented 2 months ago

I keep facing this error, can someone help? I checked the index.ts file and the CustomFormField and it all looks great.

Screenshot 2024-07-10 at 4 06 32 AM
ashdib commented 2 months ago

i think the problem at the contants>index.ts. I do this export type Gender = "Male" | "Female" | "Other";

aarxa commented 2 months ago

i think the problem at the contants>index.ts. I do this export type Gender = "Male" | "Female" | "Other";

I tried that but if I assign it as a type how can I use it as a value in RegisterForm.tsx

FinzyPHINZY commented 1 month ago

I'm having the same issue. @aarxa how did you resolve it?

FinzyPHINZY commented 1 month ago

For anyone who might be facing this issue later, the problem is coming from the appwrite db. the enums value in the gender attributes were registered as 'male','female','other'. so you can change that to "Male"... on appwrite or just change the enum value in the validation.ts and the genderOptions in the /constants/index.ts to "male"...