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.
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.