fix: team page data (#11382)

pull/11359/head
Leo Giovanetti 2023-09-15 09:38:55 -03:00 committed by GitHub
parent 6e3a1369f8
commit a2873c740b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import { Avatar } from "@calcom/ui";
type TeamType = Omit<NonNullable<TeamWithMembers>, "inviteToken">;
type MembersType = TeamType["members"];
type MemberType = MembersType[number] & { safeBio: string | null };
type MemberType = Pick<MembersType[number], "id" | "name" | "bio" | "username"> & { safeBio: string | null };
type TeamTypeWithSafeHtml = Omit<TeamType, "members" | "inviteToken"> & { members: MemberType[] };
const Member = ({ member, teamName }: { member: MemberType; teamName: string | null }) => {

View File

@ -312,7 +312,13 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
const safeBio = markdownToSafeHTML(team.bio) || "";
const members = team.members.map((member) => {
return { ...member, safeBio: markdownToSafeHTML(member.bio || "") };
return {
name: member.name,
id: member.id,
bio: member.bio,
username: member.username,
safeBio: markdownToSafeHTML(member.bio || ""),
};
});
const markdownStrippedBio = stripMarkdown(team?.bio || "");