sfbrigade / compass

https://compass-chi.vercel.app
12 stars 12 forks source link

Fix add student error logic #330

Closed KCCPMG closed 1 month ago

KCCPMG commented 1 month ago

In reference to issue #327, moves bulk of logic from routers/case_manager addStudent procedure over to lib/db_helpers/case_manager createAndAssignStudent function. Also creates specific errors, which are thrown by the new function to allow better information for the client to display. There is no client aspect to this PR, though making that final connection could easily be added to this PR. Also adds several additional tests on the routers/case_manager.test.ts to ensure that the correct errors are being thrown in the correct circumstances.