Skip to content

Commit

Permalink
feat(trip): add id on response
Browse files Browse the repository at this point in the history
  • Loading branch information
Franco Méndez committed Oct 23, 2019
1 parent 4317290 commit 045089e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions get_trip.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-unresolved
const aws = require('aws-sdk');

const dynamoDB = new aws.DynamoDB.DocumentClient();
Expand All @@ -21,21 +22,19 @@ async function getSpot(spotID) {
Key: {
id: spotID
},
ProjectionExpression: 'spot_id, address, city, commune, icon, lat, lon, #name, #type',
ProjectionExpression: 'spot_id, address, id, city, commune, icon, lat, lon, #name, #type',
ExpressionAttributeNames: {
'#name': 'name',
'#type': 'type'
},
}
};
const data = await dynamoDB.get(params).promise();
return data.Item;
}

async function translateSpotId(spotsArray) {
return await Promise.all(
spotsArray.map(async (pointId) => {
return await getSpot(pointId);
})
spotsArray.map(async (pointId) => await getSpot(pointId))
);
}

Expand Down

0 comments on commit 045089e

Please sign in to comment.