server.get('/api/projects/:id', (req, res) => {
const { id } = req.params;
const projectId = { id };
db('projects').where(projectId).first()
.then(project => {
if(!project){
res.status(404)
}
db('actions').where({'project_id' : projectId})
.then(actions => {
project.actions = actions
res.json(project)
})
})
.catch(err => {
res.send(err.message)
})
});
Может кто-нибудь сказать мне, почему не работает запрос .where в db-вызове 'actions'?