Debuglogs

This commit is contained in:
Hariom Balhara 2023-06-21 17:57:02 +05:30
parent 4748641c22
commit d93f031589
2 changed files with 14 additions and 0 deletions

View File

@ -362,6 +362,13 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
const { user: userParam } = paramsSchema.parse(context.params);
// dynamic groups are not generated at build time, but otherwise are probably cached until infinity.
const isDynamicGroup = getUsernameList(userParam).length > 1;
console.log(
"DynamicGroupLog",
JSON.stringify({
userParam,
isDynamicGroup,
})
);
if (isDynamicGroup) {
return await getDynamicGroupPageProps(context);
} else {

View File

@ -156,6 +156,13 @@ const paramsSchema = z.object({ type: z.string(), user: z.string() });
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const { user } = paramsSchema.parse(context.params);
const isDynamicGroup = getUsernameList(user).length > 1;
console.log(
"DynamicGroupLog",
JSON.stringify({
user,
isDynamicGroup,
})
);
return isDynamicGroup ? await getDynamicGroupPageProps(context) : await getUserPageProps(context);
};