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

Edit the AddToCart end point to remove items from your cart. #93

Open
Palisar opened this issue Nov 28, 2021 · 5 comments · Fixed by #90
Open

Edit the AddToCart end point to remove items from your cart. #93

Palisar opened this issue Nov 28, 2021 · 5 comments · Fixed by #90
Assignees
Labels
api anything related to the back-end task Describes a child task of a user story
Milestone

Comments

@Palisar
Copy link
Contributor

Palisar commented Nov 28, 2021

No description provided.

@Palisar Palisar added api anything related to the back-end task Describes a child task of a user story labels Nov 28, 2021
@Palisar Palisar added this to the MVP milestone Nov 28, 2021
@Palisar
Copy link
Contributor Author

Palisar commented Nov 28, 2021

This is self explanatory the CartController.cs needs to be updated with a method for handling this.
Also dont forget we need mediatr here so you will have to add a command to the CartCommands.cs and create a handler for this.
Feel free to ask any questions with this issue.

@valincius
Copy link
Member

I think we can reuse the add to cart action. Rename it like “update cart” then if the quantity is 0, remove the item

@Palisar
Copy link
Contributor Author

Palisar commented Nov 28, 2021

I was thinking that at first also but this handler already handles creates and updates if we want to keep the code simple and readable would it be better to give it it's own hander ?

@pobiega
Copy link
Collaborator

pobiega commented Nov 28, 2021

I agree with John, keep it as one and rename it. It really won't be complicated or unreadable, its just two extra lines of code or so :)

@Palisar
Copy link
Contributor Author

Palisar commented Nov 28, 2021

Ok got it !

@Palisar Palisar changed the title Add an end point to remove items from your cart. Edit the AddToCart end point to remove items from your cart. Nov 28, 2021
@Palisar Palisar self-assigned this Nov 29, 2021
@Palisar Palisar linked a pull request Feb 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api anything related to the back-end task Describes a child task of a user story
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants