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 9 refactor api calls #9

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

Conversation

FranciscoPerez
Copy link
Owner

@FranciscoPerez FranciscoPerez commented May 10, 2023

Changes

  1. Create redux state, actions, thunks and reducer function for order logic.
  2. Update fetch calls to axios calls.

Branched from issue #8 (fp-8-add-edit-delete)

Purpose

API calls are scattered across several components that have other concerns. This can make troubleshooting difficult.

Issue #9

Approach

Convert fetch api calls into axios calls.

Move API calls and orders array into its own redux state and actions.

Implement order redux into each component that referenced the orders array or corresponding API calls.

Testing Steps

Navigate to /view-orders/ page.

Delete Test

  1. Click the Delete button.
  2. Verify the deleted order was removed.

Edit and Confirm Test

  1. Click the Edit button.
  2. Verify item description and quantity fields convert to select input fields.
  3. Verify button choices now display Confirm and Cancel.
  4. Change the item description and quantity values.
  5. Click the Confirm button and verify changes were saved.

Edit and Cancel Test

  1. Click the Edit button.
  2. Verify item description and quantity fields convert to select input fields.
  3. Verify button choices now display Confirm and Cancel.
  4. Change the item description and quantity values.
  5. Click the Cancel button.
  6. Verify item description and quantity remain unchanged.

Learning

Reviewed the existing auth redux implementation and followed a similar design pattern.

Closes #9

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