Skip to content

Commit 6eaa0e6

Browse files
refacto to make the code easier and clearer
1 parent 4905093 commit 6eaa0e6

File tree

3 files changed

+12
-65
lines changed

3 files changed

+12
-65
lines changed

modules/greenbidsBidAdapter.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export const spec = {
2424
* @return boolean True if this is a valid bid, and false otherwise.
2525
*/
2626
isBidRequestValid: function (bid) {
27-
if (typeof bid.params !== 'undefined' && parseInt(getValue(bid.params, 'gbPlacementId')) > 0) {
27+
if (typeof bid.params !== 'undefined' && parseInt(getValue(bid.params, 'placementId')) > 0) {
2828
return true;
2929
} else {
30-
logError('Greenbids bidder adapter requires gbPlacementId to be defined and a positive number');
30+
logError('Greenbids bidder adapter requires placementId to be defined and a positive number');
3131
return false;
3232
}
3333
},
@@ -117,7 +117,7 @@ export const spec = {
117117
ad: bid.ad,
118118
requestId: bid.bidId,
119119
creativeId: bid.creativeId,
120-
gbPlacementId: bid.gbPlacementId,
120+
placementId: bid.placementId,
121121
};
122122
if (bid.dealId) {
123123
bidResponse.dealId = bid.dealId
@@ -199,12 +199,12 @@ function getTimeToFirstByte(win) {
199199

200200
function cleanBidsInfo(bids) {
201201
const reqObj = {};
202-
let gbPlacementId = getValue(bids.params, 'gbPlacementId');
202+
let placementId = getValue(bids.params, 'placementId');
203203
const gpid = deepAccess(bids, 'ortb2Imp.ext.gpid');
204204
reqObj.sizes = getSizes(bids);
205205
reqObj.bidId = getBidIdParameter('bidId', bids);
206206
reqObj.bidderRequestId = getBidIdParameter('bidderRequestId', bids);
207-
reqObj.gbPlacementId = parseInt(gbPlacementId, 10);
207+
reqObj.placementId = parseInt(placementId, 10);
208208
reqObj.adUnitCode = getBidIdParameter('adUnitCode', bids);
209209
reqObj.transactionId = bids.ortb2Imp?.ext?.tid || '';
210210
if (gpid) { reqObj.gpid = gpid; }

src/utils/privacy.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

test/spec/modules/greenbidsBidAdapter_specs.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('greenbidsBidAdapter', () => {
2626
let bid = {
2727
'bidder': 'greenbids',
2828
'params': {
29-
'gbPlacementId': 4242
29+
'placementId': 4242
3030
},
3131
'adUnitCode': 'adunit-code',
3232
'sizes': [[300, 250], [300, 600]],
@@ -51,7 +51,7 @@ describe('greenbidsBidAdapter', () => {
5151
let bidNonGBCompatible2 = {
5252
'bidder': 'greenbids',
5353
'params': {
54-
'gbPlacementId': 'toto'
54+
'placementId': 'toto'
5555
},
5656
};
5757

@@ -841,7 +841,7 @@ describe('greenbidsBidAdapter', () => {
841841
'ttl': 360,
842842
'width': 300,
843843
'creativeId': 'er2ee',
844-
'gbPlacementId': 4242
844+
'placementId': 4242
845845
}, {
846846
'ad': AD_SCRIPT,
847847
'cpm': 0.5,
@@ -851,7 +851,7 @@ describe('greenbidsBidAdapter', () => {
851851
'ttl': 360,
852852
'width': 350,
853853
'creativeId': 'fs3ff',
854-
'gbPlacementId': 4242,
854+
'placementId': 4242,
855855
'dealId': 'ABC_123',
856856
'ext': {
857857
'dsa': {
@@ -881,7 +881,7 @@ describe('greenbidsBidAdapter', () => {
881881
'ad': AD_SCRIPT,
882882
'requestId': '3ede2a3fa0db94',
883883
'creativeId': 'er2ee',
884-
'gbPlacementId': 4242
884+
'placementId': 4242
885885
}, {
886886
'cpm': 0.5,
887887
'width': 350,
@@ -904,7 +904,7 @@ describe('greenbidsBidAdapter', () => {
904904
'ad': AD_SCRIPT,
905905
'requestId': '4fef3b4gb1ec15',
906906
'creativeId': 'fs3ff',
907-
'gbPlacementId': 4242,
907+
'placementId': 4242,
908908
'dealId': 'ABC_123'
909909
}
910910
]
@@ -937,7 +937,7 @@ let bidRequests = [
937937
{
938938
'bidder': 'greenbids',
939939
'params': {
940-
'gbPlacementId': 4242
940+
'placementId': 4242
941941
},
942942
'adUnitCode': 'adunit-code',
943943
'sizes': [[300, 250], [300, 600]],

0 commit comments

Comments
 (0)