You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I feel like I'm missing something obvious but after not being able to figure it for a while, I figured I'd ask here.
I have some nested blocks, which when using the "regular" sdk, I can get like so:
However when I try to do the same thing using this module and following the useAsyncData example in the docs, it doesn't return any of the blocks, only the first set of "first-level" fields that it grabs using '*'.`
Doing something like
fields: ['*.*.*.*']
does return everything but I'd just like to figure out how to properly return the selected data.
Any pointers on what I might be missing to get this working would be much appreciated!
The text was updated successfully, but these errors were encountered:
Since version 5.x of this module (and the current rewrite, still unreleased, at #273 ) are based on Nuxt's $fetch we must work with the normal RestAPI syntax, this means that in your usecase you would have something like:
Thanks a lot! Just in case anybody else stumbles upon this, the simplest way to get a list of all the blocks with the respective collection name for conditional rendering and whatnot, was simply:
fields: [
'blocks.collection',
'blocks.item.*',
]
sandros94
changed the title
How to correctly access nested Blocks
how to correctly access nested fields
Oct 2, 2024
I feel like I'm missing something obvious but after not being able to figure it for a while, I figured I'd ask here.
I have some nested blocks, which when using the "regular" sdk, I can get like so:
However when I try to do the same thing using this module and following the useAsyncData example in the docs, it doesn't return any of the blocks, only the first set of "first-level" fields that it grabs using '*'.`
Doing something like
fields: ['*.*.*.*']
does return everything but I'd just like to figure out how to properly return the selected data.
Any pointers on what I might be missing to get this working would be much appreciated!
The text was updated successfully, but these errors were encountered: