Model.findById(req.params.id, cb) returns null (SOLVED)

Hello,

This is my file and for some reason req.params.id returns null. What do you think it is?

Maybe someone wouldn’t mind pair programming with me. :blush: anyone?

You are missing /:id

router.get('/new/:id, function (bla, bla, bla...
1 Like

but new doesn’t have an id yet? in my app.js I have:

app.use('/users/:user_id/gifts', giftsRoute);

but maybe that’s why. Because in users I didn’t use :user_id, I just used :id un the user routes

and that’s what it was. I just had to change :user_id to :id and now my user returns an object. I owe you.