Closed hunterwilkins2 closed 3 years ago
Going to look into this right now. May be a bit more complex
I think I have this feature working for the card fields. The problem is, I can't seem to get Yup to throw an error when a field is empty unless the field is required (which the card stuff is not), so I have a hard time hooking this into the validation schema that I use to prevent submission. Meaning, if someone enters all their mandatory info and one piece of their card info, all the other card fields will be highlighted as invalid until the correct stuff is in them, but the user could still go ahead and submit with partial information.
Could you create a separate validation schema for address and payment, then submit when none of the optional fields are filled in, or just throw an error when the user tries to submit but doesn't have each field filled out? I quickly looked over the formik docs and it seems like it might be possible if you just manually add an if statement to see if setValues is true. I haven't worked with formik before so you would know if this would actually be possible.
Yea I could look into that. Is this something you want me to prioritize, or something I should save for the future?
It's probably something you can save for the future. What are you going to work on next?
Working on the edit profile page for sure. Any other suggestions/more pressing work?
Ok, sounds good. I implemented the auth today so we can go ahead and hook up the register and login. It would be nice if we could refactor the front end to combine admin and customers for this deliverable.
Got it working. Would be nice if someone would test it since there's a decent chance I missed something
I'm not sure how easy it will be to implement, but if a user fills out one of the fields in address or payment, the form should require that all the other fields are filled out. Otherwise, if none of the fields is field out then the user should be able to register.