BULL-1244 | Update Soft Delete to Hard Delete for course_pending_registrations tuples
I have updated the issue where a duplicate pending request for adding a user to a course as a pending request fails.
The bug was fixed by applying a hard delete rather than a soft delete.
The fault resided in the section where a user was approved to join a course, and then a soft delete occurred. Once the soft delete occurred, the corresponding tuple in the course_pending_request table still existed and was only just updated to mention when it was deleted(Which is okay). When another user attempts to add the same user to the course as a pending request it fails. It fails because the unique fields mentioned within the sequalize model class are courseID and userID whereas in the SQL table, the primary key is the auto increment ID. Theoretically, this should not fail since we have the primary key as an auto increment variable so there should never really be a duplicate. However, this is out of the scope of this ticket.
Steps to test the bug fix:
- Launch Launchboard using the local development docker compose
- Add a second user, add the user to teams, add the user to team_members table via SQL commands
- Create a course within using Launchboard-FE
- Add a pending request for the second user created to the newly created course using Launchboard-FE
- Approve the pending request using Launchboard-FE
- Add another pending request for the second user again using Launchboard-FE and no error should pop up or run the following SQL command to ensure the table does not contain the user anymore:
select * from course_pending_registrations;