parent
25cefed095
commit
79e1151ee6
|
@ -26,7 +26,11 @@ export async function queryDirectiveRenderer(
|
||||||
const rendered = await renderTemplate(parsedQuery.render, results[0]);
|
const rendered = await renderTemplate(parsedQuery.render, results[0]);
|
||||||
return rendered.trim();
|
return rendered.trim();
|
||||||
} else {
|
} else {
|
||||||
return jsonToMDTable(results[0]);
|
if (results[0].length === 0) {
|
||||||
|
return "No results";
|
||||||
|
} else {
|
||||||
|
return jsonToMDTable(results[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Too many query results: ${results.length}`);
|
throw new Error(`Too many query results: ${results.length}`);
|
||||||
|
|
Loading…
Reference in New Issue