Skip to content

Instantly share code, notes, and snippets.

@diaswrd
Created January 20, 2016 19:05
Show Gist options
  • Save diaswrd/cb199ca4151ce64398e9 to your computer and use it in GitHub Desktop.
Save diaswrd/cb199ca4151ce64398e9 to your computer and use it in GitHub Desktop.
bruno_help.js
MerchantCampaign.find({
filter: {
where: {
merchantId: $scope.user.merchantId
}
}
}, function (campaignList) {
$scope.campaignList = campaignList;
Offer.find({
filter: {
where: {
merchantId: $scope.user.merchantId
}
}
}, function (offersList) {
for (var campaign in campaignList) {
campaignList[campaign].offerList = [];
for (var offer in offersList) {
if (offersList[offer].id != campaignList[campaign].offerId) {
continue;
}
campaignList[campaign].offerList.push(offersList[offer]);
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment