storyblok / storyblok-js-client

Universal JavaScript client for Storyblok's API
MIT License
127 stars 87 forks source link

Support resolve relations in bridge events #58

Closed dsteinbach closed 4 years ago

dsteinbach commented 4 years ago

I am listening for changes from the Storyblok editor (using storyblok-nuxt) but event.story.content does not contain resolved relations like my initial api request to storyblok has. What's the solution to this? I'd rather not run window.location.reload() on the input event.

    this.$storybridge.on(['input', 'published', 'change'], (event) => {
      if (event.action == 'input') {
        if (event.story.id === this.story.id) {
          this.story.content = event.story.content
        }
      } else {
        window.location.reload()
      }
    })

Thanks!

emanuelgsouza commented 4 years ago

Hi, thanks for submit this issue. We fixed this problem (it was not related to storyblok-js-client itself, but, in our platform). You can check here: https://www.storyblok.com/cl/resolve-relations-with-storyblok-bridge

dsteinbach commented 4 years ago

Thank you!