brahimelkaceh / eCommerce

3 stars 0 forks source link

User Story 6: Delete a Category (admin access only) #24

Open saloua-kd opened 1 year ago

saloua-kd commented 1 year ago

Task 1: Implement the API route for deleting a category. Task 2: Validate and process the request. Task 3: Check if there are associated products. If yes, prevent deletion and return an error message. Task 4: Check if there are associated subcategories. If yes, show confirmation message for deletion. Task 5: If no products are associated, remove the category from the database. Task 6: Return a confirmation message or an error message if the deletion was prevented.

saloua-kd commented 1 year ago

verify token of admin , using "tokenCheck" middleware !!!!