@@ -355,7 +355,7 @@ export const decideGuGateTypeNonConsentedIreland = (
355355} ;
356356
357357export const getTreatmentsRequestPayloadToGateType = (
358- getTreatmentsRequestPayload : GetTreatmentsRequestPayload ,
358+ payload : GetTreatmentsRequestPayload ,
359359) : GateType => {
360360 // This function is a pure function (without any side effects) which gets the body
361361 // of a '/auxia/get-treatments' request and returns the correct GateType.
@@ -378,18 +378,15 @@ export const getTreatmentsRequestPayloadToGateType = (
378378 // body.shouldServeDismissible take priority over the fact that body.showDefaultGate
379379 // could possibly have value 'mandatory'
380380
381- if (
382- getTreatmentsRequestPayload . showDefaultGate !== undefined &&
383- getTreatmentsRequestPayload . shouldServeDismissible
384- ) {
381+ if ( payload . showDefaultGate !== undefined && payload . shouldServeDismissible ) {
385382 return 'GuDismissible' ;
386383 }
387384
388385 // --------------------------------------------------------------
389386 // The attribute showDefaultGate overrides any other behavior
390387
391- if ( getTreatmentsRequestPayload . showDefaultGate ) {
392- if ( getTreatmentsRequestPayload . showDefaultGate == 'mandatory' ) {
388+ if ( payload . showDefaultGate ) {
389+ if ( payload . showDefaultGate == 'mandatory' ) {
393390 return 'GuMandatory' ;
394391 } else {
395392 return 'GuDismissible' ;
@@ -403,10 +400,10 @@ export const getTreatmentsRequestPayloadToGateType = (
403400 // might be decommissioned in the future.
404401
405402 if (
406- ! isValidContentType ( getTreatmentsRequestPayload . contentType ) ||
407- ! isValidSection ( getTreatmentsRequestPayload . sectionId ) ||
408- ! isValidTagIds ( getTreatmentsRequestPayload . tagIds ) ||
409- ! articleIdentifierIsAllowed ( getTreatmentsRequestPayload . articleIdentifier )
403+ ! isValidContentType ( payload . contentType ) ||
404+ ! isValidSection ( payload . sectionId ) ||
405+ ! isValidTagIds ( payload . tagIds ) ||
406+ ! articleIdentifierIsAllowed ( payload . articleIdentifier )
410407 ) {
411408 return 'None' ;
412409 }
@@ -417,13 +414,13 @@ export const getTreatmentsRequestPayloadToGateType = (
417414 // traffic (consented or not consented) to Auxia. (For privacy vigilantes reading this,
418415 // Auxia is not going to process non consented traffic for targetting.)
419416
420- if ( getTreatmentsRequestPayload . countryCode === 'IE' ) {
421- if ( mvtIdIsAuxiaAudienceShare ( getTreatmentsRequestPayload . mvtId ) ) {
417+ if ( payload . countryCode === 'IE' ) {
418+ if ( mvtIdIsAuxiaAudienceShare ( payload . mvtId ) ) {
422419 return 'AuxiaAPI' ;
423420 } else {
424421 return decideGuGateTypeNonConsentedIreland (
425- getTreatmentsRequestPayload . dailyArticleCount ,
426- getTreatmentsRequestPayload . gateDisplayCount ,
422+ payload . dailyArticleCount ,
423+ payload . gateDisplayCount ,
427424 ) ;
428425 }
429426 }
@@ -440,9 +437,9 @@ export const getTreatmentsRequestPayloadToGateType = (
440437 // That split used to be done client side, but it's now been moved to SDC and is driven by
441438 // `mvtIdIsAuxiaAudienceShare`.
442439
443- if ( ! mvtIdIsAuxiaAudienceShare ( getTreatmentsRequestPayload . mvtId ) ) {
444- if ( getTreatmentsRequestPayload . should_show_legacy_gate_tmp ) {
445- return decideGateTypeNoneOrDismissible ( getTreatmentsRequestPayload . gateDismissCount ) ;
440+ if ( ! mvtIdIsAuxiaAudienceShare ( payload . mvtId ) ) {
441+ if ( payload . should_show_legacy_gate_tmp ) {
442+ return decideGateTypeNoneOrDismissible ( payload . gateDismissCount ) ;
446443 } else {
447444 return 'None' ;
448445 }
0 commit comments