Skip to content

Commit

Permalink
use bidId or bidIds in the payload (#4903)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentproxistore authored Mar 8, 2020
1 parent ef66d93 commit 19b7319
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/proxistoreBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ function _mapSizes(sizes) {

function _createServerRequest(bidRequests, bidderRequest) {
const payload = {
bidId: bidRequests.map(req => req.bidId),
auctionId: bidRequests[0].auctionId,
transactionId: bidRequests[0].transactionId,
sizes: _mapSizes(bidRequests.map(x => x.sizes)),
Expand All @@ -20,6 +19,9 @@ function _createServerRequest(bidRequests, bidderRequest) {
}
};

const bidIds = bidRequests.map(req => req.bidId);
bidIds.length === 1 ? payload.bidId = bidIds[0] : payload.bidIds = bidIds;

const options = {
contentType: 'application/json',
withCredentials: true
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/proxistoreBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,15 @@ describe('ProxistoreBidAdapter', function () {
});
it('should have the value consentGiven to true bc we have 418 in the vendor list', function () {
const data = JSON.parse(request.data);

expect(data.gdpr.consentString).equal(bidderRequest.gdprConsent.consentString);
expect(data.gdpr.applies).to.be.true;
expect(data.gdpr.consentGiven).to.be.true;
});
it('should have a property bidId if there is only one bid', function () {
const data = JSON.parse(request.data);
expect(data.hasOwnProperty('bidId')).to.be.true;
})
});

describe('interpretResponse', function () {
Expand Down

0 comments on commit 19b7319

Please sign in to comment.