@open-mercato/core 0.7.1-develop.7181.1.702cedc42c → 0.7.1-develop.7183.1.db9678eeb8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { escapeLikePattern } from '@open-mercato/shared/lib/db/escapeLikePattern'
2
- import { locales } from '@open-mercato/shared/lib/i18n/config'
2
+ import { getSupportedLocales } from '@open-mercato/shared/lib/i18n/locale-set'
3
3
  import { matchCountryCodes } from '@open-mercato/shared/lib/location/countries'
4
4
 
5
5
  /**
@@ -15,7 +15,11 @@ export function buildWarehouseListSearchOr(term: string): Array<Record<string, u
15
15
  { city: { $ilike: like } },
16
16
  { country: { $ilike: like } },
17
17
  ]
18
- const matchedCountryCodes = matchCountryCodes(term, { locales })
18
+ // The served set, not the shipped baseline: an operator searching in a locale
19
+ // their app registered should match country names in that locale too.
20
+ // `resolveCountryName` goes through `Intl.DisplayNames`, so any code the
21
+ // runtime has region data for resolves without shipping a table.
22
+ const matchedCountryCodes = matchCountryCodes(term, { locales: [...getSupportedLocales()] })
19
23
  if (matchedCountryCodes.length > 0) {
20
24
  orFilters.push({ country: { $in: matchedCountryCodes } })
21
25
  }