Skip to content

Feat/cs 44220 variants support #153

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

Closed
wants to merge 6 commits into from

Conversation

sunil-lakshman
Copy link
Contributor

No description provided.

Copy link
Contributor

@nadeem-cs nadeem-cs left a comment

Choose a reason for hiding this comment

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

Hey Sunil, since variants functionality only requires headers addition and no URL change, we dont need to create a new Entry instance on Variants call. We can directly implement variants method in Entry and Query class.
Example:

const query = Stack.ContentType(<ct_uid>).Query();
query.variants('variant_header1').toJSON().find();

or

const entry = Stack.ContentType(<ct_uid>).Entry(<entry_uid>);
entry.variants('variant_header1').toJSON().fetch();

@sunil-lakshman
Copy link
Contributor Author

Hey Sunil, since variants functionality only requires headers addition and no URL change, we dont need to create a new Entry instance on Variants call. We can directly implement variants method in Entry and Query class. Example: const query = Stack.ContentType(<ct_uid>).Query(); query.variants('variant_header1').toJSON().find(); or const entry = Stack.ContentType(<ct_uid>).Entry(<entry_uid>); entry.variants('variant_header1').toJSON().fetch();

Noted @nadeem-cs.

Copy link
Contributor

@nadeem-cs nadeem-cs left a comment

Choose a reason for hiding this comment

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

Approved.
@sunil-lakshman Please add type support for variants and raise a seperate PR.
Thanks.

@sunil-lakshman sunil-lakshman reopened this Sep 5, 2024
@sunil-lakshman sunil-lakshman deleted the feat/CS-44220-variants-support branch September 5, 2024 10:00
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.

2 participants