MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / addAction

Function addAction

client/js-client/src/rlClient.js:209–222  ·  view source on GitHub ↗
(type, callback, user_id, item_id, rlabs, source, rectag, pos, click_only, extra_data)

Source from the content-addressed store, hash-verified

207 }
208
209 function addAction(type, callback, user_id, item_id, rlabs, source, rectag, pos, click_only, extra_data) {
210 return withMandatory("user_id", user_id, function () {
211 var urlparams = retrieveSeldonParamsFromURL(),
212 id = item_id || currentPageId(params.retain),
213 recId = rlabs || urlparams[0],
214 tag = rectag || extractExtraSeldonParams(urlparams).rt,
215 position = pos || extractExtraSeldonParams(urlparams).p,
216 url;
217
218 extra_data = ((typeof extra_data) === 'object') ? JSON.stringify(extra_data) : extra_data; // check if extra_data is an object, so will need to be stringified
219 url = actionUrl(type, user_id, id, recId, source, tag, position, click_only, extra_data);
220 jsonpCall(url, callback);
221 });
222 }
223
224 function recommendedUsers(user_id, item_id, callback) {
225 return withMandatory("user_id", user_id, function () {

Callers

nothing calls this directly

Calls 6

withMandatoryFunction · 0.85
currentPageIdFunction · 0.85
extractExtraSeldonParamsFunction · 0.85
actionUrlFunction · 0.85
jsonpCallFunction · 0.85

Tested by

no test coverage detected