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

Option to prevent fetch story #3

Merged
merged 1 commit into from
May 12, 2020
Merged

Conversation

didkan
Copy link
Collaborator

@didkan didkan commented May 12, 2020

Problem
Whenever you use the StoryblokMixin.ts it will try and fetch a story for the current url.
We are using the mixin in a header component on our site.
This result in a http request with 404 result for every page on our site.
If you want to use the StoryblokMixin.ts without this undesired behavior we need to be able to tell it not to.

Solution
Added a data property storyblok.fetchStory (default true) that will control if a story should be fetched or not. When using the mixin in a component, just add this property set to false to prevent the fetch:

data () {
  return {
    storyblok: {
      fetchStory: false
    }
  }
}

@didkan didkan merged commit 9cf63c2 into master May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant