feat: add new option to categorySearch module, defaultCategories, use to populate the category list when you don't want to poll backend for the main category list

This commit is contained in:
Julian Lam
2025-04-08 13:31:23 -04:00
parent 695312f17f
commit a487d5f6f2
2 changed files with 13 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ define('categorySearch', ['alerts', 'bootstrap', 'api'], function (alerts, boots
const categorySearch = {};
categorySearch.init = function (el, options) {
let categoriesList = null;
let categoriesList = options.defaultCategories || null;
options = options || {};
options.privilege = options.privilege || 'topics:read';
options.states = options.states || ['watching', 'tracking', 'notwatching', 'ignoring'];