tweak `inferSSRProps` to not need `as const` (#591)

This commit is contained in:
Alex Johansson 2021-09-08 13:03:43 +02:00 committed by GitHub
parent e587432894
commit a9a6d69ba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -242,7 +242,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
if (!user) {
return {
notFound: true,
} as const;
};
}
const eventType = await prisma.eventType.findUnique({
where: {
@ -271,7 +271,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
if (!eventType || eventType.hidden) {
return {
notFound: true,
} as const;
};
}
// check this is the first event

View File

@ -1097,7 +1097,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
if (!eventType) {
return {
notFound: true,
} as const;
};
}
if (eventType.userId != session.user.id) {

View File

@ -609,7 +609,7 @@ export async function getServerSideProps(context: NextPageContext) {
redirect: {
permanent: false,
destination: "/auth/login",
} as const,
},
};
}
const user = await prisma.user.findFirst({

View File

@ -25,7 +25,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!booking?.user || !booking.eventType) {
return {
notFound: true,
} as const;
};
}
return {