This commit is contained in:
parent
3c19b1c7bc
commit
6caf3d6d40
@ -481,20 +481,21 @@ module.exports = (app, client) => {
|
|||||||
parser(),
|
parser(),
|
||||||
pick({ filter: 'hits.hits' }),
|
pick({ filter: 'hits.hits' }),
|
||||||
streamArray(),
|
streamArray(),
|
||||||
data => {
|
data => data.value._source
|
||||||
|
])
|
||||||
|
pipeline.on('data', data => {
|
||||||
block_count++
|
block_count++
|
||||||
instancescomment.push({
|
instancescomment.push({
|
||||||
instance: data.value._source.instance, comment: data.value._source.blocks.find(block => block.domain === clean(req.params.instance)).comment
|
instance: data.instance, comment: data.blocks.find(block => block.domain === clean(req.params.instance)).comment
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
])
|
|
||||||
result.pipe(pipeline)
|
|
||||||
pipeline.on('end', () => {
|
pipeline.on('end', () => {
|
||||||
res.json({
|
res.json({
|
||||||
block_count,
|
block_count,
|
||||||
instances: instancescomment
|
instances: instancescomment
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
result.pipe(pipeline)
|
||||||
} else {
|
} else {
|
||||||
res.status(404).end()
|
res.status(404).end()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user