diff --git a/app/geoapify.ts b/app/geoapify.ts index 62f6432d89b6d69eadb8769db944927a37507cc4..0737a9c9c3775485c106dfeeab818a7b8cc828f2 100644 --- a/app/geoapify.ts +++ b/app/geoapify.ts @@ -42,6 +42,8 @@ export const transformAutocompleteResults = ( id: place.place_id, name: place.formatted, city: place.city, + state: place.state, + country: place.country, coordinates: { latitude: place.lat, longitude: place.lon, diff --git a/app/geoapify_api_types.ts b/app/geoapify_api_types.ts index 6c958d80cbafed2ec0b4c40cc346a7545a6a97eb..27a71c14c6de82260e0d59286d05595d535f18e3 100644 --- a/app/geoapify_api_types.ts +++ b/app/geoapify_api_types.ts @@ -2,6 +2,8 @@ export type GeoapifyPlace = { place_id: string; formatted: string; city?: string; + state?: string; + country: string; lon: number; lat: number; }; diff --git a/app/geoapify_test.ts b/app/geoapify_test.ts index 4cf7f66f1f7241064695f74391bda94da6ca2694..b063f540d2bc770e34040e0050dac96cd5d0f9a1 100644 --- a/app/geoapify_test.ts +++ b/app/geoapify_test.ts @@ -37,6 +37,8 @@ const placeFragment = ` id name city + state + country coordinates { latitude longitude diff --git a/app/geoapify_test_data.ts b/app/geoapify_test_data.ts index 490f44f9a445d92bbf80a7675bc6b59065ae9cff..04ed3dafebe2e429443763607edc48a20ac60445 100644 --- a/app/geoapify_test_data.ts +++ b/app/geoapify_test_data.ts @@ -94,6 +94,8 @@ export const expectedPlacesAutocompleteGqlResponse = [ id: "51ac66e77e9826274059f9426dc08c114840f00101f901dcf3000000000000c00208", name: "Munich, Bavaria, Germany", city: "Munich", + state: "Bavaria", + country: "Germany", coordinates: { latitude: 48.1371079, longitude: 11.5753822, @@ -103,6 +105,8 @@ export const expectedPlacesAutocompleteGqlResponse = [ id: "51b1a888d349b558c059b0aa5e7ea7554840f00101f90194c5020000000000c00208", name: "Munich, ND, United States of America", city: "Munich", + state: "North Dakota", + country: "United States", coordinates: { latitude: 48.669174, longitude: -98.832631, diff --git a/app/server.ts b/app/server.ts index db5202ffbb98698a6aa573ade0844c3136103f09..58d61ac04609b374f6619ae7549b4b03e307a960 100644 --- a/app/server.ts +++ b/app/server.ts @@ -23,6 +23,8 @@ const typeDefs = ` id: String! name: String! city: String + state: String + country: String! coordinates: Coordinates! } diff --git a/app/types.ts b/app/types.ts index fc98b8fc81ddd5fcbdd0e2598f0382fec30b0b46..ffe293042829f18a785f5e2e7ef43e00f00d53d7 100644 --- a/app/types.ts +++ b/app/types.ts @@ -9,6 +9,8 @@ export interface Place { id: string; name: string; city?: string; //This is a temporary field which will be used by the frontend when filtering for spaces + state?: string; + country: string; coordinates: Coordinates; }