chore: ingest source code
58 files from https://github.com/gothinkster/node-express-realworld-example-app
This commit is contained in:
12
src/app/routes/article/author.mapper.ts
Normal file
12
src/app/routes/article/author.mapper.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { User } from '../auth/user.model';
|
||||
|
||||
const authorMapper = (author: any, id?: number) => ({
|
||||
username: author.username,
|
||||
bio: author.bio,
|
||||
image: author.image,
|
||||
following: id
|
||||
? author?.followedBy.some((followingUser: Partial<User>) => followingUser.id === id)
|
||||
: false,
|
||||
});
|
||||
|
||||
export default authorMapper;
|
||||
Reference in New Issue
Block a user