I want to remove one or two returns in the following .then()
functions:
return store.findParent(to.params.id).then((project) => {
return store.findByParent('project', project).then((result) => {
return {
project: project.toJSON(),
tasks: result
}
})
})
I tried this:
return store.findParent(to.params.id).then((project) => ({
store.findByParent('project', project).then((result) => {
project: project.toJSON(),
tasks: store.findListByParent('project', project)
})
}))
But I get
Parsing error: Unexpected identifier at tasks: store.findListByParent
What's the proper way of doing it?