Hotfix for merge loss in PR2416 (#2418)
This commit is contained in:
parent
a551919152
commit
e6587efd27
1 changed files with 3 additions and 7 deletions
|
@ -126,10 +126,7 @@ export const getGroupName = (usernameList: string[]): string => {
|
||||||
export const getUsernameSlugLink = ({ users, slug }: UsernameSlugLinkProps): string => {
|
export const getUsernameSlugLink = ({ users, slug }: UsernameSlugLinkProps): string => {
|
||||||
let slugLink = ``;
|
let slugLink = ``;
|
||||||
if (users.length > 1) {
|
if (users.length > 1) {
|
||||||
let combinedUsername = `${users[0].username}`;
|
const combinedUsername = users.map((user) => user.username).join("+");
|
||||||
for (let i = 1; i < users.length; i++) {
|
|
||||||
combinedUsername = `${combinedUsername}+${users[i].username}`;
|
|
||||||
}
|
|
||||||
slugLink = `/${combinedUsername}/${slug}`;
|
slugLink = `/${combinedUsername}/${slug}`;
|
||||||
} else {
|
} else {
|
||||||
slugLink = `/${users[0].username}/${slug}`;
|
slugLink = `/${users[0].username}/${slug}`;
|
||||||
|
@ -138,11 +135,10 @@ export const getUsernameSlugLink = ({ users, slug }: UsernameSlugLinkProps): str
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getUsernameList = (users: string): string[] => {
|
export const getUsernameList = (users: string): string[] => {
|
||||||
// For Team booking, users might be undefined
|
|
||||||
return users
|
return users
|
||||||
?.toLowerCase()
|
?.toLowerCase()
|
||||||
.replace(" ", "+")
|
.replace(/ /g, "+")
|
||||||
.replace("%20", "+")
|
.replace(/%20/g, "+")
|
||||||
.split("+")
|
.split("+")
|
||||||
.filter((el) => {
|
.filter((el) => {
|
||||||
return el.length != 0;
|
return el.length != 0;
|
||||||
|
|
Loading…
Reference in a new issue