Overview
parsePayload
is a helper function to parse the payload with Zod schema and the request body. It's also throw an error if the payload is invalid. This will help you to handle the payload in a type-safe way.
How to Use
You need to use it in the route handler. Here's an example of how to use it:
route.ts