Skip to content

Conversation

@crgee1 crgee1 requested a review from a team February 3, 2025 20:54
Copy link
Contributor

@Mudaafi Mudaafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for the most part. I had a couple of questions but would you mind adding variation_id to RecommendationsRequestType and updating item_id to have the type string | Array as well?

@@ -1,9 +1,10 @@
import { ConstructorClientOptions, NetworkParameters, UserParameters, VariationsMap } from '.';
import { ConstructorClientOptions, NetworkParameters, UserParameters, VariationsMap, FilterExpression } from '.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! I wonder how long it was missing :x

@@ -120,6 +129,7 @@ class Recommendations {
* @param {string} podId - Pod identifier
* @param {object} [parameters] - Additional parameters to refine results
* @param {string|array} [parameters.itemIds] - Item ID(s) to retrieve recommendations for (strategy specific)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the itemIds field, can we add "required if passing variationId"?

}

if (variationId) {
if (!itemIds) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check if it's an empty array here and error out if it is?

* @param {string} podId - Pod identifier
* @param {object} [parameters] - Additional parameters to refine results
* @param {string|array} [parameters.itemIds] - Item ID(s) to retrieve recommendations for (strategy specific)
* @param {string|array} [parameters.variationId] - Variation ID to retrieve recommendations for (strategy specific)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the type for this should just be string? I saw the RFC stating they'd want to prohibit multiple variation ids too.

@crgee1 crgee1 requested a review from Mudaafi February 4, 2025 10:29
Copy link
Contributor

@Mudaafi Mudaafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@jjl014 jjl014 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and added a red path test, but otherwise LGTM! 🚀

@jjl014 jjl014 merged commit bd77ad4 into master Feb 4, 2025
7 checks passed
@jjl014 jjl014 deleted the ci-4155-node-client-get-recommendations-support-variation-id-param branch February 4, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants