UNPKG

@kodbruket/vsf-mapping-fallback

Version:

Mapping Fallback loader for Vue Storefront

17 lines (15 loc) 424 B
import { Payload } from '../types/Payload' export const forStoryblok = async ({ dispatch }, { url: fullSlug }: Payload) => { fullSlug = fullSlug || 'home' const story = await dispatch(`storyblok/loadStory`, { fullSlug }, { root: true }) if (story) { return { name: 'storyblok', params: { // TODO: Why does this need to be here? slug: 'storyblok' } } } return undefined }