KWangechi / bank-codes-web-scrapper

A small project for getting all the bank codes and branches in Kenya
https://kenya-bank-code-search.pages.dev/
22 stars 10 forks source link

Fixes #11 combine bank name, alias and location search #16

Closed bwanamaina closed 1 month ago

bwanamaina commented 1 month ago

If you type kcb ruiru or ruiru kcb order doesn't really matter it will return all banks with name/alias kcb and all banks with branches in ruiru.

Suggestion

An ideal solution would be to have a separate filter/dropdown for the bank name and the search for any location where selected bank has a branch. This way the user can select the bank name and the location separately. This will make the search more accurate and user-friendly since we have a lot of records to filter.

KWangechi commented 1 month ago

Woow, Nakwambia vitu naona hapa, I'm learning so much from you... kwani what JS do I writeπŸ˜‚ but this is crazy because I had thought of doing exactly this(matching all the search terms with either the alias, bank name or branch name) but didn't know how I would go about the matching, even thinking on using the && logical operator after splitting the search term either by a whitespace or a comma, nikaona haimake sense...

Thank you for this!!!πŸ˜ƒπŸ˜ƒ

KWangechi commented 1 month ago

Bytha, out of curiosity, I've noticed you're not a big fan of arrow functions in JS, is there a reason why? Maybe the cons perhaps?

bwanamaina commented 1 month ago

The JS you write is the international one πŸ˜ƒ hakuna tofauti. The first thought was to use comma separated search term in this format: kcb, ruiru while this makes sense, typing ruiru, kcb would end up confusing the logic... hio nikaweka kando πŸ˜‚

bwanamaina commented 1 month ago

About named/anonymous functions vs arrow functions, this is just a personal preference, I don't think there is any cons, but I find code written in arrow functions harder to read, especially the ones used without curly braces... unashindwa block imeanza wapi hadi wapi. For instance take a look at this two lines you can't easily tell where each ends πŸ˜•