Fix: TomSelect addOption для загруженных групп

 this.addOption(item) для каждой группы из API
 Опции теперь доступны в this.options

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mirivlad 2026-03-30 14:08:58 +08:00
parent 964a0fd9e1
commit df8172070a
1 changed files with 4 additions and 0 deletions

View File

@ -77,6 +77,10 @@ document.addEventListener('DOMContentLoaded', function() {
.then(json => {
// Фильтруем уже выбранные
const filtered = json.filter(item => !selectedTags.has(String(item.id)));
// Добавляем опции в TomSelect
filtered.forEach(item => {
this.addOption(item);
});
callback(filtered);
}).catch(() => {
callback();