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

bugfix(common) allow classes as data parameter in createParamDecorato… #1562

Merged
merged 1 commit into from
May 30, 2019
Merged

bugfix(common) allow classes as data parameter in createParamDecorato… #1562

merged 1 commit into from
May 30, 2019

Conversation

Hossein-s
Copy link
Contributor

@Hossein-s Hossein-s commented Feb 15, 2019

PR Checklist

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

When we pass class type as data parameter to createParamDecorator function, it will be recognized as Pipe and data will be null in the factory. 😞

What is the new behavior?

We can pass classes as data parameter 😃

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@coveralls
Copy link

coveralls commented Feb 15, 2019

Pull Request Test Coverage Report for Build 2021

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 93.698%

Totals Coverage Status
Change from base Build 2019: 0.002%
Covered Lines: 2996
Relevant Lines: 3141

💛 - Coveralls

@@ -49,7 +49,8 @@ export function createParamDecorator(

const isPipe = pipe =>
pipe &&
((isFunction(pipe) && pipe.prototype) || isFunction(pipe.transform));
((isFunction(pipe) && pipe.prototype && isFunction(pipe.prototype.transform)) ||
Copy link

@kibertoad kibertoad Feb 19, 2019

Choose a reason for hiding this comment

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

Is it possible to add test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is 😃 I thought it may not be necessary for bugs. I'll add it, thanks.

Copy link
Member

Choose a reason for hiding this comment

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

+1

@kamilmysliwiec
Copy link
Member

Ping 🏓

@Hossein-s
Copy link
Contributor Author

@kamilmysliwiec Sorry for being late. I have updated PR with test.

@Hossein-s
Copy link
Contributor Author

@kamilmysliwiec
I wanted to publish a helper decorator for graphql dataloader that needs this bug to be fixed.
Is there any issue with this PR?

@kamilmysliwiec kamilmysliwiec added this to the 6.3.0 milestone May 30, 2019
@kamilmysliwiec kamilmysliwiec merged commit f448878 into nestjs:master May 30, 2019
@lock
Copy link

lock bot commented Sep 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants