Advertisement
nikolayneykov

Untitled

Nov 28th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async findPosts(options: any): Promise<PostDTO[]> {
  2.     const foundPosts: Post[] = await this.postsRepository
  3.       .find({
  4.         where: { isDeleted: false },
  5.         order: { creationDate: 'DESC' },
  6.         take: options.take || '10',
  7.         skip: options.skip || '0',
  8.       });
  9.  
  10.     return foundPosts.map((post: Post) => {
  11.       return this.mapper.toPostDTO(post);
  12.     });
  13.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement