From 497de1dac63b993182058aad5c0b0e7d36bb5a20 Mon Sep 17 00:00:00 2001 From: Dawntraoz Date: Mon, 28 Nov 2022 18:47:50 +0100 Subject: [PATCH] fix: add apiOptions to key field-level translation --- lib/src/runtime/composables/useAsyncStoryblok.js | 4 +++- playground/pages/index.vue | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/src/runtime/composables/useAsyncStoryblok.js b/lib/src/runtime/composables/useAsyncStoryblok.js index a1eb5a44..4ba76a0e 100644 --- a/lib/src/runtime/composables/useAsyncStoryblok.js +++ b/lib/src/runtime/composables/useAsyncStoryblok.js @@ -19,8 +19,10 @@ export const useAsyncStoryblok = async ( } }); + const hash = JSON.stringify(apiOptions); + const { data } = await useAsyncData( - url, + `${hash}-${url}`, async () => await storyblokApiInstance.get(`cdn/stories/${url}`, apiOptions) ); story.value = data.value.data.story; diff --git a/playground/pages/index.vue b/playground/pages/index.vue index cb9b5a7d..e5614118 100644 --- a/playground/pages/index.vue +++ b/playground/pages/index.vue @@ -1,5 +1,9 @@