sandboxnu / cooper

A tool for Northeastern students to both submit reviews of their co-ops and filter through reviews of co-ops left by other students.
https://coopernu.vercel.app/
2 stars 0 forks source link

Add basic error handling to the `companyRouter` #29

Closed RishikeshNK closed 7 months ago

RishikeshNK commented 7 months ago

When the user tries to access / update / delete a company that does not exist, a TRPC error is not produced (instead a Prisma error is). Essentially, before doing these operations, add a check to validate that the company is present in the database by using a findUnique. If not, throw a TRPCError. See other files in the router folder for reference.

Should be a very small ticket -- I somehow missed this during code review for the company router PR :P