mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 16:38:34 +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) => {
|
||||
// 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,
|
||||
},
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue