mirror of
https://github.com/we-promise/sure.git
synced 2026-05-25 13:34:58 +00:00
fix(enable_banking): match bank list search against BIC, not just name (#1874)
* fix(enable_banking): match bank list search against BIC, not just name Bank-search filter on the Enable Banking bank-selection modal only indexed `aspsp[:name]`, so users searching by BIC code (e.g. `INGDDEFF`) got no results even when the bank was rendered in the list. Switch the per-item data attribute to a `name + BIC` haystack and read from it in the Stimulus controller, so either token matches. Refs #1814 * style(bank_search): apply Biome formatting to forEach callback (#1874 review)
This commit is contained in:
@@ -7,9 +7,9 @@ export default class extends Controller {
|
||||
const query = this.inputTarget.value.toLocaleLowerCase().trim();
|
||||
let visibleCount = 0;
|
||||
|
||||
this.itemTargets.forEach(item => {
|
||||
const name = item.dataset.bankName?.toLocaleLowerCase() ?? "";
|
||||
const match = name.includes(query);
|
||||
this.itemTargets.forEach((item) => {
|
||||
const haystack = (item.dataset.bankSearch ?? "").toLocaleLowerCase();
|
||||
const match = haystack.includes(query);
|
||||
item.style.display = match ? "" : "none";
|
||||
if (match) visibleCount++;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user