Created
January 20, 2016 19:05
-
-
Save diaswrd/cb199ca4151ce64398e9 to your computer and use it in GitHub Desktop.
bruno_help.js
This file contains 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
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