Type-safety for dates when returning DB entries as JSON
I used to use Prisma in server components where I don't need to do serialization.
Now I need to return DB entries from an API route handler in JSON form.
This means, the Date type of the Prisma model is not correct on the client anymore. JSONification turns the Date into a string.
What's the correct way to handle this on the client so I have type-safety?
Now I need to return DB entries from an API route handler in JSON form.
This means, the Date type of the Prisma model is not correct on the client anymore. JSONification turns the Date into a string.
What's the correct way to handle this on the client so I have type-safety?