Backend route to delete a course returns 500. This makes it impossible to delete a course.
Steps to Reproduce
Bring up two windows to the app. Log in to both. In first, bring up /swagger-ui/index.html. In second, go to the courses page, to list the courses. (You'll need the id values).
In a separate window, get the Bearer token needed to work with swagger-ui
Go to swagger ui window and go to the GET route /api/member/courses and make sure that the token works to list the courses. You should get a response code of 200, not 500, and a JSON list of courses.
Now go to the DELETE route and try to delete one of the courses.
Expected / Desired Behavior
A 200 response and JSON showing that the course was deleted.
Observed / Actual Behavior
A 500 response and this error JSON:
{
"timestamp": 1622221082340,
"status": 500,
"error": "Internal Server Error",
"message": "could not execute statement; SQL [n/a]; constraint [fk27jy419dq1wprrmncet75njds]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement",
"path": "/api/admin/courses/1"
}
Discussion
This may have to do with cascading deletes... i.e. removing all of the records that may depend on this course, i.e. tutor assignments, office hours, tutor notes, etc.
Bug Report
Backend route to delete a course returns 500. This makes it impossible to delete a course.
Steps to Reproduce
/swagger-ui/index.html
. In second, go to the courses page, to list the courses. (You'll need theid
values)./api/member/courses
and make sure that the token works to list the courses. You should get a response code of200
, not500
, and a JSON list of courses.Expected / Desired Behavior
A 200 response and JSON showing that the course was deleted.
Observed / Actual Behavior
A 500 response and this error JSON:
Discussion
This may have to do with cascading deletes... i.e. removing all of the records that may depend on this course, i.e. tutor assignments, office hours, tutor notes, etc.