tweak inferSSRProps
to not need as const
(#591)
This commit is contained in:
parent
e587432894
commit
a9a6d69ba6
4 changed files with 5 additions and 5 deletions
|
@ -242,7 +242,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return {
|
return {
|
||||||
notFound: true,
|
notFound: true,
|
||||||
} as const;
|
};
|
||||||
}
|
}
|
||||||
const eventType = await prisma.eventType.findUnique({
|
const eventType = await prisma.eventType.findUnique({
|
||||||
where: {
|
where: {
|
||||||
|
@ -271,7 +271,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||||
if (!eventType || eventType.hidden) {
|
if (!eventType || eventType.hidden) {
|
||||||
return {
|
return {
|
||||||
notFound: true,
|
notFound: true,
|
||||||
} as const;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// check this is the first event
|
// check this is the first event
|
||||||
|
|
|
@ -1097,7 +1097,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||||
if (!eventType) {
|
if (!eventType) {
|
||||||
return {
|
return {
|
||||||
notFound: true,
|
notFound: true,
|
||||||
} as const;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventType.userId != session.user.id) {
|
if (eventType.userId != session.user.id) {
|
||||||
|
|
|
@ -609,7 +609,7 @@ export async function getServerSideProps(context: NextPageContext) {
|
||||||
redirect: {
|
redirect: {
|
||||||
permanent: false,
|
permanent: false,
|
||||||
destination: "/auth/login",
|
destination: "/auth/login",
|
||||||
} as const,
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const user = await prisma.user.findFirst({
|
const user = await prisma.user.findFirst({
|
||||||
|
|
|
@ -25,7 +25,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||||
if (!booking?.user || !booking.eventType) {
|
if (!booking?.user || !booking.eventType) {
|
||||||
return {
|
return {
|
||||||
notFound: true,
|
notFound: true,
|
||||||
} as const;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue