Skip to content

Commit

Permalink
🐛 Fix 404 error on invite page (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevella authored Oct 9, 2023
1 parent 3a57a95 commit e85045a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/web/src/pages/invite/[urlId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const getStaticPaths = async () => {

export const getStaticProps: GetStaticProps = async (ctx) => {
// We get these props to be able to render the og:image
const poll = await prisma.poll.findUniqueOrThrow({
const poll = await prisma.poll.findUnique({
where: {
id: ctx.params?.urlId as string,
},
Expand All @@ -199,6 +199,10 @@ export const getStaticProps: GetStaticProps = async (ctx) => {
},
});

if (!poll) {
return { props: {}, notFound: 404 };
}

const res = await getStaticTranslations(ctx);

if ("props" in res) {
Expand Down

1 comment on commit e85045a

@vercel
Copy link

@vercel vercel bot commented on e85045a Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app – ./

rallly-vert.vercel.app
app-git-main-rallly.vercel.app
app-rallly.vercel.app
app.rallly.co

Please sign in to comment.