Support searching chants by name

This commit is contained in:
DominikDoom
2023-05-11 21:17:55 +02:00
parent 7fbfb7dd43
commit 3169c4c653

View File

@@ -7,7 +7,7 @@ class ChantParser extends BaseTagParser {
let tempResults = [];
if (tagword !== "<" && tagword !== "<c:") {
let searchTerm = tagword.replace("<chant:", "").replace("<c:", "").replace("<", "");
let filterCondition = x => x.terms.toLowerCase().includes(searchTerm);
let filterCondition = x => x.terms.toLowerCase().includes(searchTerm) || x.name.toLowerCase().includes(searchTerm);
tempResults = chants.filter(x => filterCondition(x)); // Filter by tagword
} else {
tempResults = chants;