Closed ancasimon closed 4 years ago
smash function below:
const getDestinationsWithDiaryEntries = () => new Promise((resolve, reject) => {
destinationData.getDestinations()
.then((destinationResponse) => {
diaryData.getDiaryEntries().then((diaryResponse) => {
console.error('dest respo', destinationResponse);
console.error('diary respo', diaryResponse);
const finalDestinations = [];
diaryResponse.forEach((diary) => {
const selectedDestination = destinationResponse.find((x) => x.id === diary.destinationId);
finalDestinations.push(selectedDestination);
resolve(finalDestinations);
console.error('final dest', finalDestinations);
});
});
})
.catch((error) => reject(error));
});
User Story
Once a user has written about a place at least once, change the color of the card for that place.
AC
WHEN I go to the Travel Diary site and add a diary entry for a destination, THEN the background color of the destination card changes.
Dev Notes