Improve logs and Fix unwanted 500 to reduce noise in logs (#2674)
* Improve logs * Fix unintentional 500 Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>pull/2707/head^2
parent
746643bf8e
commit
50f1fe544e
|
@ -94,6 +94,13 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||||
|
|
||||||
if (!users.length) return { notFound: true };
|
if (!users.length) return { notFound: true };
|
||||||
const [user] = users;
|
const [user] = users;
|
||||||
|
const isDynamicGroupBooking = users.length > 1;
|
||||||
|
|
||||||
|
// Dynamic Group link doesn't need a type but it must have a slug
|
||||||
|
if ((!isDynamicGroupBooking && !context.query.type) || (isDynamicGroupBooking && !eventTypeSlug)) {
|
||||||
|
return { notFound: true };
|
||||||
|
}
|
||||||
|
|
||||||
const eventTypeRaw =
|
const eventTypeRaw =
|
||||||
usernameList.length > 1
|
usernameList.length > 1
|
||||||
? getDefaultEvent(eventTypeSlug)
|
? getDefaultEvent(eventTypeSlug)
|
||||||
|
@ -173,8 +180,6 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||||
booking = await getBooking(prisma, context.query.rescheduleUid as string);
|
booking = await getBooking(prisma, context.query.rescheduleUid as string);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDynamicGroupBooking = users.length > 1;
|
|
||||||
|
|
||||||
const dynamicNames = isDynamicGroupBooking
|
const dynamicNames = isDynamicGroupBooking
|
||||||
? users.map((user) => {
|
? users.map((user) => {
|
||||||
return user.name || "";
|
return user.name || "";
|
||||||
|
|
|
@ -25,6 +25,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||||
res.status(404);
|
res.status(404);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
res.status(500);
|
res.status(500);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue