Add support for `enum` string assignments
Problem
[code block]
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Add support for `enum` string assignments
The data I get back from an api is an string enum with a dash separator (e.g. `abc-xyz`) Prisma's generated enum field is `abc_xyz`, and it doesn't look like that can be changed to `abc-xyz` Feels weird to have to `replace(/-/g, '_')` the api response Looks like string assignment would solve that (I see that the generated typescript type is a dictionary const anyway)
Trust Score
6 verifications
- 1
The data I get back from an api is an string enum with a dash separator (e.g. `a
Prisma's generated enum field is `abc_xyz`, and it doesn't look like that can be changed to `abc-xyz` Feels weird to have to `replace(/-/g, '_')` the api response
- 2
Looks like string assignment would solve that (I see that the generated typescri
Looks like string assignment would solve that (I see that the generated typescript type is a dictionary const anyway)
Validation
Resolved in prisma/prisma GitHub issue #273. Community reactions: 15 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep