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

Integrate new shop apis + bug fixes #229

Merged
merged 47 commits into from
Sep 9, 2024
Merged

Conversation

alvyynm
Copy link
Member

@alvyynm alvyynm commented Aug 8, 2024

Have you read the contributing guidelines ?

What is the purpose of your pull request?

  • Bug fix
  • New feature

Proposed changes

Resolves #228 by integrating the new shop api to the product detail page.

In addition to that, the PR introduces the following changes:

  • Change single product URL to use the item's slug instead of id.
  • Allow the user to view different item images by clicking on the small product images below
  • Fix shop cart functionality (add to cart, remove from cart)
  • Handle different API statuses appropriately in /shop and /shop/item/:slug
  • Open the shopping cart when the user clicks the shopping cart icon
  • Prevent user from adding more items than available stock in the selected product variant
  • Fix "Maximum update depth exceeded" error in CartDrawer
  • Create useDeleteAllSwag mutation hook to clear backend cart items once the user makes an order
  • Clear local storage cart after successful order

(From the video below, I've noted some UI issues. I'll fix soon #230. If you notice more, let me know, and I'll add them to #230)

Recording.9.mp4

Existing issues I encountered while working with the API

  • The API does seem to update the cart items, but it doesn't return anything when trying to get the cart contents (an empty array is returned instead). This means you can't view an order's details and make an order.
  • A way to instantly delete all items from the cart (the UI doesn't offer this option yet)
  • All images served from the API are unreachable (error 404 is returned)
  • /checkout API endpoint for placing an order currently expects city to be an int (This should be a str, not an int). The API response is as follows: "Incorrect type. Expected pk value, received str."
  • GET /api/cart-items/clear_cart/ returns 404 status code
  • products don't have rating data
  • It's not clear how a user is supposed to pay

Warning

Please read these points carefully and answer honestly with an X
into all the boxes. Example : [X]

Before submitting a pull request make sure you have:

  • Read the guidelines for contributing.
  • Wrote some tests.
  • Respected the linting guidelines.

@alvyynm alvyynm self-assigned this Aug 8, 2024
Copy link

vercel bot commented Aug 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
syt-web-redesign ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 3:34am

sonylomo
sonylomo previously approved these changes Aug 8, 2024
Copy link
Collaborator

@sonylomo sonylomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alvyynm
Copy link
Member Author

alvyynm commented Aug 8, 2024

Hi @sonylomo, this PR is still a WIP.

@alvyynm alvyynm changed the title Feat/integrate new shop apis Integrate new shop apis + bug fixes Aug 10, 2024
@alvyynm alvyynm marked this pull request as ready for review August 10, 2024 13:32
@alvyynm
Copy link
Member Author

alvyynm commented Aug 10, 2024

@sonylomo Ready for review now.
@JimmyOty I've highlighted some of the issues I've encountered with the API in my notes above, including inaccessible images.

@JimmyTron JimmyTron merged commit c28a4bb into Dev Sep 9, 2024
4 checks passed
@JimmyTron JimmyTron deleted the feat/integrate-new-shop-apis branch September 9, 2024 14:42
CodedVeli added a commit that referenced this pull request Sep 16, 2024
Co-authored-by: sonylomo <sonylomo1@gmail.com>

[Have you read the contributing guidelines ?](https://github.com/SpaceyaTech/SYT-Web-Redesign/blob/Dev/docs/CONTRIBUTING.md)

# What is the purpose of your _pull request_?

- [ ] Bug fix
- [ ] New feature
- [ ] Documentation

# Proposed changes

# Warning

Please read these points carefully and answer honestly with an `X`
into all the boxes. Example : [X]

Before submitting a _pull request_ make sure you have:

- [ ] Read the guidelines for contributing.
- [ ] Wrote some tests.
- [ ] Respected the linting guidelines (read the guide below for help).

## How to Check and Fix Linting Issues

Run `npm run validate`. This command will run prettier and eslint checks to ensure linting guidelines are respected.

- If the command exits with code 0 (build is successful), there are no linting issues.

- If the command exits with a code other than 0, scroll up the command output and look for identified linting issues. Fix them and revalidate to check if the issues have been resolved by re-running the command.
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.

Feat: Integrate the new shop api to the product detail page
3 participants