Closed jackall3n closed 1 year ago
Hello @jackall3n , thank you for the contribution.
I agree that we need to support other types like Float
, but we shouldn't use @IsInt()
with it.
Unless you could build a custom validator, I think the safe thing to do is to remove @IsInt()
for now.
Please check review details, I left you some feedback.
@jackall3n you can try to use Decimal instead of Float, and it's work fine witdh Decimal or you can check the docs https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#decimal
@jackall3n you can try to use Decimal instead of Float, and it's work fine witdh Decimal or you can check the docs https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#decimal
Thanks @ErlanggaDewa, it's a good option I could explore for new databases, however, my one exists already and I'm not sure changing the datatype to support this library is going to be worth it.
Thanks guys. I'm merging this now. Feel free to suggest changes or improvements anytime.
Description
Adding support for the type
Float
. Givenclass-validator
doesn't have out-of-the-box support for floats, I've made it fallback to the configuration ofInt
s.