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
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 afindUnique
. If not, throw aTRPCError
. See other files in therouter
folder for reference.Should be a very small ticket -- I somehow missed this during code review for the company router PR :P