Skip to content

How to use aliases? #103

Answered by rijkvanzanten
ghost asked this question in Q&A
Jan 19, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Close! The way to translate query params to JS params object is slightly different:

const { data, error } = await useAsyncData('about', () => getSingletonItem({
    collection: 'about',
    params: {
        'alias[description]': 'meta_description'
    }
}))

(you can omit fields here, as it defaults to *, and * already includes meta_description as well)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ghost
Comment options

@ghost

This comment has been hidden.

@rijkvanzanten

This comment has been hidden.

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant