Skip to content

Commit

Permalink
Adyoulike adapter: fix eids retrieve
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisg93 committed Jun 15, 2023
1 parent 1e82414 commit c1613bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
4 changes: 2 additions & 2 deletions modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export const spec = {
payload.ortb2 = bidderRequest.ortb2;
}

if (deepAccess(bidderRequest, 'userIdAsEids')) {
payload.userId = bidderRequest.userIdAsEids;
if (deepAccess(bidRequests, '0.userIdAsEids')) {
payload.userId = bidRequests[0].userIdAsEids;
}

payload.pbjs_version = '$prebid.version$';
Expand Down
33 changes: 11 additions & 22 deletions test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,31 +708,20 @@ describe('Adyoulike Adapter', function () {
});

it('should add userid eids information to the request', function () {
let bidderRequest = {
'auctionId': '1d1a030790a475',
'bidderRequestId': '22edbae2733bf6',
'timeout': 3000,
'userIdAsEids':
[
{
'source': 'pubcid.org',
'uids': [
{
'atype': 1,
'id': '01EAJWWNEPN3CYMM5N8M5VXY22'
}
]
}
]
};

bidderRequest.bids = bidRequestWithSinglePlacement;

const request = spec.buildRequests(bidRequestWithSinglePlacement, bidderRequest);
let bidRequest = bidRequestWithSinglePlacement;
bidRequest[0].userIdAsEids = [{
'source': 'pubcid.org',
'uids': [{
'atype': 1,
'id': '01EAJWWNEPN3CYMM5N8M5VXY22'
}]
}]

const request = spec.buildRequests(bidRequest, bidderRequest);
const payload = JSON.parse(request.data);

expect(payload.userId).to.exist;
expect(payload.userId).to.deep.equal(bidderRequest.userIdAsEids);
expect(payload.userId).to.deep.equal(bidRequest[0].userIdAsEids);
});

it('sends bid request to endpoint with single placement', function () {
Expand Down

0 comments on commit c1613bc

Please sign in to comment.