Skip to content
Snippets Groups Projects
functions.ts 368 B
Newer Older
tkach-as's avatar
tkach-as committed
import { ParticipantPopulated } from "../../../backend/src/util/types";

export const formatUsernames = (
  participants: Array<ParticipantPopulated>,
  myUserId: string
): string => {
  const usernames = participants
    .filter((participant) => participant.user.id != myUserId)
    .map((participant) => participant.user.username);

  return usernames.join(", ");
};