Added no results text for Slack slash command
This commit is contained in:
@ -26,6 +26,7 @@ router.post('hooks.slack', async ctx => {
|
||||
limit: 5,
|
||||
});
|
||||
|
||||
if (documents) {
|
||||
const results = [];
|
||||
let number = 1;
|
||||
for (const document of documents) {
|
||||
@ -44,6 +45,11 @@ router.post('hooks.slack', async ctx => {
|
||||
},
|
||||
],
|
||||
};
|
||||
} else {
|
||||
ctx.body = {
|
||||
text: 'No search results',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
Reference in New Issue
Block a user