Skip to content

Commit

Permalink
fix(lang): include all language locales in search bar for doctors
Browse files Browse the repository at this point in the history
  • Loading branch information
NabbeunNabi committed Dec 4, 2024
1 parent 5d6970b commit 14d4a4f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions components/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,29 @@ const specialtiesStore = useSpecialtiesStore()
await locationsStore.fetchLocations()
const languageOptions = [{
code: '',
simpleText: '----Any----',
displayText: '----Any----'
}, ...localeStore.mvpLocaleDisplayOptions]
const languageOptions = localeStore.localeDisplayOptions
const languageOptionsWithPlaceHolder = setSearchBarLanguageDropdownOptions()
const locationDropdownOptions: Ref<string[]> = ref(locationsStore.citiesDisplayOptions)
const specialtyDropdownOptions: Ref<SpecialtyDisplayOption[]> = ref(specialtiesStore.specialtyDisplayOptions)
const languageDropdownOptions: Ref<LocaleDisplay[]> = ref(languageOptions)
const languageDropdownOptions: Ref<LocaleDisplay[]> = ref(languageOptionsWithPlaceHolder)
const selectedSpecialty: Ref<Specialty | string> = ref('')
const selectedLocation: Ref<string> = ref('')
const selectedLanguage: Ref<Locale | string> = ref('')
const placeHolderTextDisplay = '----Any----'
function setSearchBarLanguageDropdownOptions() {
// This will remove any codes code that is falsy
const localeOptionsWithLocaleCodes = languageOptions.filter(locale => locale.code)
// This will add the placeholder text
localeOptionsWithLocaleCodes
.unshift({ code: '', simpleText: placeHolderTextDisplay, displayText: placeHolderTextDisplay })
return localeOptionsWithLocaleCodes
}
interface CityDisplayItems {
[cityName: string]: {
cityDisplayText: string
Expand Down

0 comments on commit 14d4a4f

Please sign in to comment.