Skip to content

Commit

Permalink
refactor: filter null user
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL committed May 8, 2024
1 parent 7ca5161 commit 0921161
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions components/molecules/cards/PostThumbnailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ export function PostThumbnailCard({
func = undefined,
},
}: IPostThumbnailCardObj) {
const userAvatarArr = participants.map((par) => {
return {
image: par.profileImage,
...(par.avatar?.type !== null ? { avatar: par.avatar } : {}),
};
});
const userAvatarArr = participants
.filter((par) => par)
.map((par) => {
return {
image: par.profileImage,
...(par.avatar?.type !== null ? { avatar: par.avatar } : {}),
};
});

return (
<CardLink href={url} onClick={func}>
Expand Down

0 comments on commit 0921161

Please sign in to comment.