Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobian RTD module: ensure object to modify exists #11902

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions modules/mobianRtdProvider.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
/**
* This module adds the Mobian RTD provider to the real time data module
* The {@link module:modules/realTimeData} module is required
* @module modules/anonymisedRtdProvider
* @requires module:modules/realTimeData
*/
import { submodule } from '../src/hook.js';
import { ajaxBuilder } from '../src/ajax.js';
import { deepSetValue } from '../src/utils.js';

/**
* @typedef {import('../modules/rtdModule/index.js').RtdSubmodule} RtdSubmodule
*/

export const MOBIAN_URL = 'https://impact-api-prod.themobian.com/brand_safety';

/** @type {RtdSubmodule} */
export const mobianBrandSafetySubmodule = {
name: 'mobianBrandSafety',
gvlid: null,
init: init,
getBidRequestData: getBidRequestData
};
Expand Down Expand Up @@ -36,10 +48,12 @@ function getBidRequestData(bidReqConfig, callback, config) {
'mobianGarmRisk': mobianGarmRisk
};
resolve(risk);
ortb2Site.ext.data['mobian'] = risk
deepSetValue(ortb2Site.ext, 'data.mobian', risk);
callback()
},
error: function () {
resolve({});
callback()
}
});
});
Expand Down
4 changes: 1 addition & 3 deletions test/spec/modules/mobianRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ describe('Mobian RTD Submodule', function () {
ortb2Fragments: {
global: {
site: {
ext: {
data: {}
}
ext: {}
}
}
}
Expand Down