From 82690c8fb14d54f3fbc14ec277494ba3ea02dfe4 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Date: Sat, 27 Apr 2024 16:32:59 -0700 Subject: [PATCH] chore: cleanup --- .../core/__tests__/parseAWSExports.test.ts | 8 ++------ packages/core/src/parseAWSExports.ts | 19 ++++++++----------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/packages/core/__tests__/parseAWSExports.test.ts b/packages/core/__tests__/parseAWSExports.test.ts index c599ed347d3..1ad4520f7d5 100644 --- a/packages/core/__tests__/parseAWSExports.test.ts +++ b/packages/core/__tests__/parseAWSExports.test.ts @@ -33,7 +33,7 @@ describe('parseAWSExports', () => { }, region, }; - const amazonLocationServiceV4 = { + const expectedAmazonLocationServiceV4 = { maps: { items: { geoJsExampleMap1: { @@ -45,10 +45,6 @@ describe('parseAWSExports', () => { }, default: 'geoJsExampleMap1', }, - search_indices: { - items: ['geoJSSearchExample'], - default: 'geoJSSearchExample', - }, searchIndices: { items: ['geoJSSearchExample'], default: 'geoJSSearchExample', @@ -122,7 +118,7 @@ describe('parseAWSExports', () => { }, }, Geo: { - LocationService: amazonLocationServiceV4, + LocationService: expectedAmazonLocationServiceV4, }, Storage: { S3: { diff --git a/packages/core/src/parseAWSExports.ts b/packages/core/src/parseAWSExports.ts index e6b6cc5bba7..295c9e211e8 100644 --- a/packages/core/src/parseAWSExports.ts +++ b/packages/core/src/parseAWSExports.ts @@ -249,17 +249,14 @@ export const parseAWSExports = ( // Geo if (geo) { const { amazon_location_service } = geo; - (amplifyConfig as any).Geo = amazon_location_service - ? { - LocationService: { - ...amazon_location_service, - maps: amazon_location_service.maps, - geofenceCollections: amazon_location_service.geofenceCollections, - searchIndices: amazon_location_service.search_indices, - region: amazon_location_service.region, - }, - } - : { ...geo }; + amplifyConfig.Geo = { + LocationService: { + maps: amazon_location_service.maps, + geofenceCollections: amazon_location_service.geofenceCollections, + searchIndices: amazon_location_service.search_indices, + region: amazon_location_service.region, + }, + }; } // REST API