From bbe1d28334a4a03adcfe2e158a7d642cbf70c6f0 Mon Sep 17 00:00:00 2001 From: Amar Trebinjac Date: Mon, 24 Nov 2025 11:20:21 +0100 Subject: [PATCH 1/2] feat: allow country-region search --- src/integrations/mapbox/clients.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/mapbox/clients.ts b/src/integrations/mapbox/clients.ts index 50b2ddbbd..1ac98b183 100644 --- a/src/integrations/mapbox/clients.ts +++ b/src/integrations/mapbox/clients.ts @@ -39,7 +39,7 @@ export class MapboxClient implements IMapboxClient { async autocomplete(query: string): Promise { return this.garmr.execute(async () => { - const url = `${this.baseUrl}?q=${encodeURIComponent(query)}&types=country,place&limit=5&access_token=${this.accessToken}`; + const url = `${this.baseUrl}?q=${encodeURIComponent(query)}&types=country,region,place&limit=5&access_token=${this.accessToken}`; const response = await fetch(url); From 676d050840aecf061d05a0b16555cb6110c6edf0 Mon Sep 17 00:00:00 2001 From: Amar Trebinjac Date: Mon, 24 Nov 2025 11:50:04 +0100 Subject: [PATCH 2/2] update tests --- __tests__/schema/autocompletes.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/__tests__/schema/autocompletes.ts b/__tests__/schema/autocompletes.ts index e29f82210..467682f4e 100644 --- a/__tests__/schema/autocompletes.ts +++ b/__tests__/schema/autocompletes.ts @@ -439,7 +439,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'new york', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, }) @@ -506,7 +506,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'united states', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, }) @@ -611,7 +611,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'san', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, }) @@ -647,7 +647,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'test', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, }) @@ -676,7 +676,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'nonexistentlocation', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, }) @@ -698,7 +698,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'test', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, }) @@ -757,7 +757,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'berlin', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, }) @@ -794,7 +794,7 @@ describe('query autocompleteLocation', () => { .get('/search/geocode/v6/forward') .query({ q: 'San Francisco, CA', - types: 'country,place', + types: 'country,region,place', limit: 5, access_token: process.env.MAPBOX_ACCESS_TOKEN, })