tweak inferSSRProps to not need as const (#591)

This commit is contained in:
Alex Johansson
2021-09-08 11:03:43 +00:00
committed by GitHub
parent e587432894
commit a9a6d69ba6
4 changed files with 5 additions and 5 deletions
+2 -2
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
+1 -1
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) {
+1 -1
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({
+1 -1
View File
@@ -25,7 +25,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!booking?.user || !booking.eventType) {
return {
notFound: true,
} as const;
};
}
return {