Skip to content
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

Wrong Return type for useStoryblok() #895

Open
1 task done
samuelemde opened this issue Aug 6, 2024 · 1 comment
Open
1 task done

Wrong Return type for useStoryblok() #895

samuelemde opened this issue Aug 6, 2024 · 1 comment
Assignees
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised

Comments

@samuelemde
Copy link

Describe the issue you're facing

When using the new useStoryblok() wrapper to use the live preview in Storyblok, the function only returns the story object. This prevents us from using the assets array returned by setting resolve_assets: 1, because the assets array is on the same level as the story in the original response.

Reproduction

https://stackblitz.com/edit/astro-sdk-demo-s3f9zj?file=src%2Fpages%2Findex.astro

Steps to reproduce

const story = await useStoryblok(`cdn/stories/${slug}`, getFetchParams(version, language), {}, Astro)

// there is no way to access the resolved assets array here

System Info

astro: 4.13.1,
@storyblok/astro: 5.0.0,

Used Package Manager

npm

Error logs (Optional)

No response

Validations

@samuelemde samuelemde added pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Aug 6, 2024
@dipankarmaikap
Copy link
Contributor

Hi @samuelemde,

Thank you for raising this issue. The Astro live preview feature is currently experimental, but we have an upcoming release that will make this process simpler and address the concerns you've mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

2 participants