Resolve query parameters to the appropriate model instances. For example, after the implementation, a route like:
router.get("/{userId}", async (req, res) => {
const user = await User.findByPk(req.params.userId);
return user;
});
Should be written to the following and achieve the same result:
router.get("/{user}", (req, res) => {
return user;
});
Resolve query parameters to the appropriate model instances. For example, after the implementation, a route like:
Should be written to the following and achieve the same result: