We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This would require replacing all the dirac calls with controller methods (at least all the reads)
The text was updated successfully, but these errors were encountered:
If you wanted to continue using dirac-middleware, some simple middleware could support slugs:
module.exports = ( options )=>{ options = utils.defaults( options || {}, { idParam: 'id' }); return ( req, res, next )=>{ var id = req.params[ options.idParam ]; if ( isNaN( +id ) ){ req.queryObj.text_id = id; } else { req.queryObj.id = id; } return next(); }; };
Or you could just use the .getRestaurant() middleware to fetch the restaurant, which already supports fetching by slug
.getRestaurant()
Sorry, something went wrong.
And of course, that could be generalized further
L8D
No branches or pull requests
This would require replacing all the dirac calls with controller methods (at least all the reads)
The text was updated successfully, but these errors were encountered: