This PR enhances the existing course deletion logic by ensuring that any duplicated resources associated with the course are properly identified and removed.
[x] Ensures that all duplicated resources are cleaned up before a course is deleted, preventing orphaned or unnecessary data in the database.
[x] Improves the maintainability and clarity of the codebase by separating concerns into distinct functions.
Enhanced the course deletion process
This PR enhances the existing course deletion logic by ensuring that any duplicated resources associated with the course are properly identified and removed.