How to use aliases? #103
-
I want to retrieve the const { data, error } = await useAsyncData('about', () => getSingletonItem({
collection: 'about',
params: {
fields: ['*', 'meta_description'],
alias: '[description]=meta_description'
}
})) … but it doesn’t work … How to use aliases? |
Beta Was this translation helpful? Give feedback.
Answered by
rijkvanzanten
Jan 19, 2023
Replies: 1 comment 3 replies
-
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 |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Close! The way to translate query params to JS params object is slightly different:
(you can omit fields here, as it defaults to
*
, and*
already includesmeta_description
as well)