Adding an "enabled" attribute to templates
This commit is contained in:
@@ -51,8 +51,11 @@ export async function templateSlashComplete(
|
||||
completeEvent: CompleteEvent,
|
||||
): Promise<SlashCompletion[]> {
|
||||
const allTemplates = await queryObjects<TemplateObject>("template", {
|
||||
// Only return templates that have a trigger
|
||||
filter: ["attr", "trigger"],
|
||||
// Only return templates that have a trigger and are not expliclty disabled
|
||||
filter: ["and", ["attr", "trigger"], ["!=", ["attr", "enabled"], [
|
||||
"boolean",
|
||||
false,
|
||||
]]],
|
||||
});
|
||||
return allTemplates.map((template) => ({
|
||||
label: template.trigger!,
|
||||
|
||||
Reference in New Issue
Block a user