-
Notifications
You must be signed in to change notification settings - Fork 7
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
belindas-closet-android_3_175_add-functionality-delete-button #195
belindas-closet-android_3_175_add-functionality-delete-button #195
Conversation
- Fixed bug where deleting an item deletes all items from the same category - Fixed bug where items with invalid id still delete (when they shouldn't - Fixed non-admins being able to delete items
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected. Soft deletes a product 1 by 1 from view but you must place an objectID of a valid product under the handbag accessory (to test handbag only) in Datasource.kt. I will also note the following:
- admin must be signed in.
- this action will not set isHidden to true at this time.
*Something I overlooked*
Glad you caught this! I fixed this error due to a mistake on my part while overlooking changes to the request to client.delete. I tested this by using the objectId of a product from my local database (in Datasource.kt) and it behaves as expected and Logcat confirms this. |
Tested it and it works. ✅ To organize our services better, I believe that the Archive and Delete services should be associated with the Product. data |
Resolves #175
This PR makes it so that pressing the delete button on the frontend calls the "soft delete" API endpoint and hides the product.
For manual testing purposes, update the handbag in the 'Accessories' category to be a 24-character hex string as the id in Datasource.kt because MongoDB generates the ObjectId in this format (will otherwise throw an invalid id error).
test.delete.mp4
Note: There is currently a bug where archiving/deleting products deletes all products from that same category (issue #191), which has been addressed for deleting items in this code version while I collaborated with Hanan.
Related to User Story #102