Recommand · October 14, 2021 0

Need to redeploy on Vercel after creating data on strapi backend

My app is created on next js and strapi. Deployed on Vercel.

When I create new entries with the super admin role it works fine on dev and production but if I try this with a Author/Editor role, I get 404 error until I redeploy the app on Vercel.

This only on dynamic pages.
I don’t really know what part of the code to show you to help understand my specific case.

export async function getStaticPaths() {
  const spectacles = await fetchAPI("/spectacles")

  return {
    paths: spectacles.map((spectacle) => ({
      params: {
        slug: spectacle.slug,
      },
    })),
    fallback: false,
  }
}

export async function getStaticProps({ params }) {
  const spectacle = (await fetchAPI(`/spectacles?slug=${params.slug}`))[0]

  const [spectacles, categories] = await Promise.all([
    fetchAPI("/spectacles"),
    fetchAPI("/categories"),
  ])
  return {
    props: { spectacle: spectacle, spectacles, categories },
    revalidate: 1,
  }
}