-
-
Save myndzi/3c95475adab5ad4938e6aa3d30b0107c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getOpportunityData: function () { | |
return getDateFilter('Opportunity') | |
.then(function(dateFilterQuery) { | |
createNewAPIQuery('Opportunity'); | |
dateFilter = ''; | |
if (apiQuery != undefined) { | |
let timestamp = parseTimestamp(apiQuery[0].timestamp); | |
dateFilter = '?filter[created_after]=' + timestamp; | |
} | |
return bhttp.get( | |
HOST + '/api/private/atlas/donations' + dateFilter, | |
{headers: {'Authorization': AUTH_TOKEN}} | |
); | |
}).then(function(response) { | |
return JSON.parse(response.body).data; | |
}).map(function (donationDataEntry) { | |
return getDonorDataFromID(donationDataEntry.relationships.donor.data.id) | |
.then(response => | |
createNewDonationEntry(donationDataEntry, JSON.parse(response).data) | |
); | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment