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

Delete Product API #9

Open
ThanhIsHereee opened this issue Apr 4, 2024 · 1 comment
Open

Delete Product API #9

ThanhIsHereee opened this issue Apr 4, 2024 · 1 comment

Comments

@ThanhIsHereee
Copy link

No description provided.

@ThanhIsHereee ThanhIsHereee changed the title deleteProduct Write an deleteProduct api Apr 4, 2024
@bentran1vn bentran1vn changed the title Write an deleteProduct api Delete Product Api Apr 4, 2024
@bentran1vn bentran1vn changed the title Delete Product Api Delete Product API Apr 4, 2024
@ThanhIsHereee ThanhIsHereee self-assigned this Apr 4, 2024
@bentran1vn bentran1vn assigned ghost and unassigned ThanhIsHereee Apr 4, 2024
@ThanhIsHereee
Copy link
Author

ThanhIsHereee commented Apr 7, 2024

Delete Product API is written for Admin to delete the product. It had two types of delete. this was the delete API but in execution, you need to change the status of the product or products. set the Delete_at/Delete_by and save to the logs entity.
response type:

  • success: "delete productID: ... successfully" status 200(JSON)
  • fail by Unauthorize throw UnauthorizeException with message status 401
  • fail by saving fail throw exception
  • fail by not found product throw NotFoundException
  • fail by deleted return message as not found
  1. type 1 deletes all the products which means that when the user pushes the delete button they want to delete the whole product, delete all the product instances in the manage table.
    The request was only the ProductID.
  2. type 2 to delete individual instances of the product which means that when the user pushes the delete button they want to delete just one color or they don't want to sell that size anymore.
    The request was ProductID and the InsID.

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

No branches or pull requests

1 participant