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

req.param is not a function in blueprints/actionUtil.js #3408

Closed
jamsea opened this issue Dec 1, 2015 · 2 comments
Closed

req.param is not a function in blueprints/actionUtil.js #3408

jamsea opened this issue Dec 1, 2015 · 2 comments

Comments

@jamsea
Copy link

jamsea commented Dec 1, 2015

Been searching around for an answer to this on Google/Stack Overflow but I can't seem to find a solution. A few days ago a few of my unit tests broke, all with errors similar to:

1) blueprints:destroy should destroy a user with id = 1:
TypeError: req.param is not a function
      at Object.module.exports.populateEach (node_modules/sails/lib/hooks/blueprints/actionUtil.js:35:27)
      at destroyOneRecord (api/blueprints/destroy.js:9:502)
      at Context.<anonymous> (test/unit/blueprints/destroy.test.js:42:5)

Taking a look at actionUtil.js and the express documentation I noticed req.param is deprecated. I'm currently using "sails": "^0.11.2" in my project. I tried removing node_modules and running npm install again but I'm still getting the same issue.

My main question is: is actionUtil.js broken for anyone else? Or is it just me? If someone can confirm that I'm not crazy I can create a fix for this today and send a PR.

@RomainLanz
Copy link

This would fix your issue #3235 .

@jamsea
Copy link
Author

jamsea commented Dec 1, 2015

Just figured out my actual issue, it was my fault I had mocked something wrong in the unit test. Dumb mistake.

@jamsea jamsea closed this as completed Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants