Convert Prisma enum to Typescript enum (and opposite)
Hey guys,
I have this Prisma enum:
And also this typescript enum:
The typescript is mainly used by my front. My backend have a class to convert my front object to Prisma typescript object. My problem is I don't know how to convert from my typescript enum to the prisma enum, and transform the prisma enum to my enum.
The only solution that doesn't trigger an typescript error (not tested tho) is:
But it does not work (return undefined)
I have this Prisma enum:
And also this typescript enum:
The typescript is mainly used by my front. My backend have a class to convert my front object to Prisma typescript object. My problem is I don't know how to convert from my typescript enum to the prisma enum, and transform the prisma enum to my enum.
The only solution that doesn't trigger an typescript error (not tested tho) is:
But it does not work (return undefined)