OpenTree-Education / rhizone-lms

A learning management system focused on self-reflection.
https://rhi.zone
BSD 3-Clause Clear License
14 stars 7 forks source link

Implement functionality for the PUT /program/:programAssessmentId route and accompanying service file functions #563

Closed mays4 closed 1 year ago

mays4 commented 1 year ago

Describe the Feature / Enhancement

The PUT /program/:programAssessmentId route needs to be implemented and fully tested. The PUT /program/:programAssessmentId route updates an existing program assessment in the database.

There needs to be a test coverage for the PUT /program/:programAssessmentId route and the service file functions it needs. We need to test this route to ensure the code written for the test will behave as expected by the protocol we previously defined.

This issue continues the work from issue #515.

Additional Details and Resources

This route requires the principal ID (the user ID) from the session information, this route expects a program assessment ID in the URL as a URL parameter, and expects a ProgramAssessment in the body of the request. The response should contain the following:

Facilitator

const updatedProgramAssessment: ProgramAssessment = updateProgramAssessment(programAssessmentFromUser);

res.json(itemEnvelope(updatedProgramAssessment));

Participant

This should return an UnauthorizedError. Participants shouldn't have access to this route.

Correct Project Selected

Labels