Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwin Kumar committed Apr 27, 2024
1 parent 31af65d commit 82690c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
8 changes: 2 additions & 6 deletions packages/core/__tests__/parseAWSExports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('parseAWSExports', () => {
},
region,
};
const amazonLocationServiceV4 = {
const expectedAmazonLocationServiceV4 = {
maps: {
items: {
geoJsExampleMap1: {
Expand All @@ -45,10 +45,6 @@ describe('parseAWSExports', () => {
},
default: 'geoJsExampleMap1',
},
search_indices: {
items: ['geoJSSearchExample'],
default: 'geoJSSearchExample',
},
searchIndices: {
items: ['geoJSSearchExample'],
default: 'geoJSSearchExample',
Expand Down Expand Up @@ -122,7 +118,7 @@ describe('parseAWSExports', () => {
},
},
Geo: {
LocationService: amazonLocationServiceV4,
LocationService: expectedAmazonLocationServiceV4,
},
Storage: {
S3: {
Expand Down
19 changes: 8 additions & 11 deletions packages/core/src/parseAWSExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 82690c8

Please sign in to comment.