Skip to content

Commit 19b7319

Browse files
use bidId or bidIds in the payload (#4903)
1 parent ef66d93 commit 19b7319

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

modules/proxistoreBidAdapter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ function _mapSizes(sizes) {
99

1010
function _createServerRequest(bidRequests, bidderRequest) {
1111
const payload = {
12-
bidId: bidRequests.map(req => req.bidId),
1312
auctionId: bidRequests[0].auctionId,
1413
transactionId: bidRequests[0].transactionId,
1514
sizes: _mapSizes(bidRequests.map(x => x.sizes)),
@@ -20,6 +19,9 @@ function _createServerRequest(bidRequests, bidderRequest) {
2019
}
2120
};
2221

22+
const bidIds = bidRequests.map(req => req.bidId);
23+
bidIds.length === 1 ? payload.bidId = bidIds[0] : payload.bidIds = bidIds;
24+
2325
const options = {
2426
contentType: 'application/json',
2527
withCredentials: true

test/spec/modules/proxistoreBidAdapter_spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@ describe('ProxistoreBidAdapter', function () {
5050
});
5151
it('should have the value consentGiven to true bc we have 418 in the vendor list', function () {
5252
const data = JSON.parse(request.data);
53+
5354
expect(data.gdpr.consentString).equal(bidderRequest.gdprConsent.consentString);
5455
expect(data.gdpr.applies).to.be.true;
5556
expect(data.gdpr.consentGiven).to.be.true;
5657
});
58+
it('should have a property bidId if there is only one bid', function () {
59+
const data = JSON.parse(request.data);
60+
expect(data.hasOwnProperty('bidId')).to.be.true;
61+
})
5762
});
5863

5964
describe('interpretResponse', function () {

0 commit comments

Comments
 (0)