Skip to content
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

Rename snake case form fields #186

Open
gsidebo opened this issue Sep 13, 2021 · 0 comments
Open

Rename snake case form fields #186

gsidebo opened this issue Sep 13, 2021 · 0 comments

Comments

@gsidebo
Copy link
Contributor

gsidebo commented Sep 13, 2021

Reference: https://github.com/mitodl/mitxonline/blob/main/static/js/components/forms/ProfileFormFields.js - LegalAddressFields and ProfileFields

The legal address form fields have snake case names that match the names and structure of the API results we get from the profile/legal address endpoint. Our form field names should all be camel case (see: static/js/components/forms/ChangeEmailForm.js) to match our general JS variable naming scheme, and the API results should be mapped appropriately to those fields. We also probably don't need to namespace the field names (e.g.: name="legal_address.first_name" --> name="firstName").

I noticed this when reviewing #161. That PR appends "Error" to the end of form field names to create id values, and there was no graceful way to do that given our dot-and-snake-case form field names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant