Recap
To recap, we have added a new feature to the application, which is replying to posts.
- We updated the Prisma schema to add new
parentandrepliesrelations to thePostmodel. - We ran the migration to update the database.
- A tRPC
threadsubrouter was created for this feature, and the new router was added to the application router. - The
replymutation procedure was added to thethreadsubrouter, and the procedure's input was validated usingzod. - The new procedure can automatically be used in the client application using the
trpc.thread.reply.useMutation()hook that was automatically exposed by tRPC. - The input data can be validated using
zodandreact-hook-formbefore the mutation was called.