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