Skip to content

Commit

Permalink
add helpful comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hbjORbj committed Jan 16, 2025
1 parent be7a2f5 commit cbf9cc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/web/server/lib/[user]/getServerSideProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export const getServerSideProps: GetServerSideProps<UserPageProps> = async (cont

if (isDynamicGroup) {
const destinationUrl = `/${usernameList.join("+")}/dynamic`;

// EXAMPLE - context.params: { orgSlug: 'acme', user: 'member0+owner1' }
// EXAMPLE - context.query: { redirect: 'undefined', orgRedirection: 'undefined', user: 'member0+owner1' }
const originalQueryString = new URLSearchParams(context.query as Record<string, string>).toString();
const destinationWithQuery = `${destinationUrl}?${originalQueryString}`;
log.debug(`Dynamic group detected, redirecting to ${destinationUrl}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/defaultEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const getUsernameList = (users: string | string[] | undefined): string[]
// So, even though this code handles even if individual user is dynamic link, that isn't a possibility right now.
users = arrayCast(users);

const allUsers = users.map((user) => user.replace(/( |%20|%2b)/g, "+").split("+")).flat();
const allUsers = users.map((user) => user.replace(/( |%20|%2B)/g, "+").split("+")).flat();
return Array.prototype.concat(...allUsers.map((userSlug) => slugify(userSlug)));
};

Expand Down

0 comments on commit cbf9cc4

Please sign in to comment.