Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect parsing of integer ids when paramter type is string #271

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

zaro
Copy link

@zaro zaro commented Sep 24, 2019

Resolves #245.
For models with bigint primary keys, and PK param type specified as 'string', the request parser still parses the key to Number. This is incorrect as JS Number cannot hold safely a bigint.

This fix, parses the parameter value to string only in case the parameter type is 'number'.

See #245 for more details.

Copy link
Contributor

@Diluka Diluka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michaelyali michaelyali merged commit 2b2bff4 into nestjsx:master Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PATCH and PUT always create new record with bigint primary key
3 participants