I have an issue where preview works fine on routes that's in the link-resolver
, but routes that goes through the Route resolver
does not work and I get redirected to the 404-page.
Is there anything I can do to fix this, or is it a Beta issue?
link-resolver.js
export default function(doc) {
if (doc.isBroken) {
return `/${doc.lang}/404`;
}
if (doc.type === 'homepage' && doc.lang === 'sv') {
return '/';
}
if (doc.type === 'homepage' && doc.lang !== 'sv') {
return `/${doc.lang}`;
}
if (doc.type === 'page') {
return `/${doc.lang}/${doc.uid}`;
}
return `/${doc.lang}/404`;
}
nuxt.config.js
prismic: {
endpoint: process.env.PRISMIC_URL,
apiOptions: {
accessToken: process.env.PRISMIC_API_KEY,
routes: [
{
type: 'post',
path: '/:lang/:category/:uid',
resolvers: {
category: 'category'
}
}
]
},
disableGenerator: true
}