Files
reno-realworld-5/src/app/routes/profile/profile.utils.ts
Scaffolder 8053e114cf initial commit
Change-Id: Ifa2442bb2e786af351ef5f575ca69828870c8b6e
2026-08-03 21:12:35 +00:00

14 lines
376 B
TypeScript

import { User } from '../auth/user.model';
import { Profile } from './profile.model';
const profileMapper = (user: any, id: number | undefined): Profile => ({
username: user.username,
bio: user.bio,
image: user.image,
following: id
? user?.followedBy.some((followingUser: Partial<User>) => followingUser.id === id)
: false,
});
export default profileMapper;