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

Fp 1 fix form submit #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fp 1 fix form submit #1

wants to merge 2 commits into from

Conversation

FranciscoPerez
Copy link
Owner

@FranciscoPerez FranciscoPerez commented May 10, 2023

Changes

  1. Fix "onChange" event handler function to reference correct input value.

Purpose

Orders were not being added to the database.

Issue 1 - Order Form Submit Bug

Approach

Change the value referenced in the onChange event handler from event.value to event.target.value.
This allows the submit action to send the correct input values to the /api/add-order/ endpoint.

Testing Steps

  1. Open root page (e.g. http://localhost:3000/) and click "Go to Login" button.
  2. Click "Login" button.
  3. Click "Order Form" nav link.
  4. Select menu item.
  5. Select quantity.
  6. Click "Order it!" button.
  7. Click "View Orders" nav link.
  8. Verify placed order exists.

Learning

Troubleshooting was slightly troublesome because an error was not generated for the incorrect value reference.

The issue was evident once I traced through the form submit process.

Closes #1

Ran "npm audit fix --force" to resolve dependency conflicts that caused
a "0308010C" error on "npm start"
corrected the argument passed into the menu item and quantity state functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant