Skip to content

Conversation

@MarcMcIntosh
Copy link

Adds the suggested changes to #40 and resolves conflicts

For get_by_uid, get_by_id, get_by_ids, the default language should be * (meaning we search over all languages)

To test run python setup.py test

@MarcMcIntosh MarcMcIntosh requested a review from srenault July 23, 2020 11:21
@srenault srenault changed the title Tailsdotcom Add support for multi-languages Jul 24, 2020

def get_by_uid(self, type, uid, ref=None):
return self.query_first(predicates.at('my.' + type + '.uid', uid), ref)
def get_by_uid(self, type, uid, ref=None, lang='*'):

Choose a reason for hiding this comment

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

we forbid to use a wilcard for a getByUID since uids are defined per language.
https://github.com/prismicio/prismic-javascript/blob/master/src/ResolvedApi.ts#L199
you should implement the same logic there

Choose a reason for hiding this comment

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

And add a test to make sure you can't query without a lang

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