Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async findPosts(options: any): Promise<PostDTO[]> {
- const foundPosts: Post[] = await this.postsRepository
- .find({
- where: { isDeleted: false },
- order: { creationDate: 'DESC' },
- take: options.take || '10',
- skip: options.skip || '0',
- });
- return foundPosts.map((post: Post) => {
- return this.mapper.toPostDTO(post);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement