mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
🐛 Fix 404 error on invite page (#898)
This commit is contained in:
parent
3a57a9551d
commit
e85045a562
1 changed files with 5 additions and 1 deletions
|
@ -184,7 +184,7 @@ export const getStaticPaths = async () => {
|
||||||
|
|
||||||
export const getStaticProps: GetStaticProps = async (ctx) => {
|
export const getStaticProps: GetStaticProps = async (ctx) => {
|
||||||
// We get these props to be able to render the og:image
|
// 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: {
|
where: {
|
||||||
id: ctx.params?.urlId as string,
|
id: ctx.params?.urlId as string,
|
||||||
},
|
},
|
||||||
|
@ -199,6 +199,10 @@ export const getStaticProps: GetStaticProps = async (ctx) => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!poll) {
|
||||||
|
return { props: {}, notFound: 404 };
|
||||||
|
}
|
||||||
|
|
||||||
const res = await getStaticTranslations(ctx);
|
const res = await getStaticTranslations(ctx);
|
||||||
|
|
||||||
if ("props" in res) {
|
if ("props" in res) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue