-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signup form validation #22
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/ibi-group/otp-admin-ui/jz6l998fu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but on the condition that we come up with a better way to handle error checking for secureFetch
.
onChange={handleChange} | ||
type='checkbox' | ||
/> | ||
</Form.Group> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it somewhat weird to handle this checkbox differently than the items in field layout. I would kind of expect that the fields are either all included in the field layout object or all explicitly written out in the jsx markup. This isn't blocking though
// "detail": null | ||
// } | ||
const adminUser = adminUserFetchResult.data.id ? adminUserFetchResult.data : null | ||
const apiUser = apiUserFetchResult.data.id ? apiUserFetchResult.data : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right way for us to be error checking. Is it possible to use SWR here? I can't recall what led to secureFetch being called here. No need to handle here, but please create an issue referencing this block so that we fix this (a comment like the one you've included should never really be necessary).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces form validation for new API users using Formik and yup.
The PR also fixes #21 and removes an unwanted message shown when a new API user clicks
Create Account
.