I added three files (risk-edit.ts, risk-types.ts, and risk-edit.test.ts) to develop the endpoint for editing a risk. In risk-edit.ts, I validated incoming data using middy (riskEditInputSchemaBody from risk-types.ts), edited the selected risk from the database, and finally let this endpoint return the edited risk from the database.
Notes
Need to provide screenshots and test the endpoint manually to make sure the endpoint for editing risk works.
Test Cases
Case A: Check if the event object fails (statuscode: 400) when the incoming inputs to the risk edit endpoint have no Risk id.
Result: Pass
Case B: Check if the event object fails (statuscode: 400) when the invalid user is trying to edit the Risk from the database.
Result: Pass
Screenshots (if applicable)
Any relevant screenshots go here
To Do
Any remaining things that need to get done
[x] Fix the error on lines 33 and 42 in risk-edit.ts
[ ] Check up with the implementation of updating the risk from the database in risk-edit.ts
[ ] Manually testing
Checklist
It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your squad if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.
[x] All commits are tagged with the ticket number
[x] No linting errors
[x] No newline at end of file warnings
[x] All code follows repository-configured prettier formatting
[ ] No merge conflicts
[x] All checks passing
[ ] Screenshots of UI changes (if applicable)
[ ] Remove any not-applicable sections
[x] Assign the PR to yourself
[x] PR is linked to the ticket
[x] No package-lock.json changes (unless dependencies have changed)
Changes
I added three files (risk-edit.ts, risk-types.ts, and risk-edit.test.ts) to develop the endpoint for editing a risk. In risk-edit.ts, I validated incoming data using middy (riskEditInputSchemaBody from risk-types.ts), edited the selected risk from the database, and finally let this endpoint return the edited risk from the database.
Notes
Need to provide screenshots and test the endpoint manually to make sure the endpoint for editing risk works.
Test Cases
Screenshots (if applicable)
Any relevant screenshots go here
To Do
Any remaining things that need to get done
Checklist
It can be helpful to check the
Checks
andFiles changed
tabs. Please review the contributor guide and reach out to your squad if anything is unclear. Please request reviewers and ping on slack only after you've gone through this whole checklist.package-lock.json
changes (unless dependencies have changed)Closes # (issue #)