-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharticle.controller.ts
More file actions
20 lines (18 loc) · 1012 Bytes
/
article.controller.ts
File metadata and controls
20 lines (18 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Body, Controller, Post, Get, Req, UseInterceptors, Param, Query } from '@nestjs/common';
import { UserAuthInterceptor } from 'src/auth/interceptors/user-auth.interceptor';
import { ArticleService } from './article.service';
import { RequestWithUserData } from 'src/common/types/request-with-user.type';
import { ArticleSearchDto } from './dto/article-search.dto';
import { Article, ArticleDetailed } from './entities';
import { PdfDownloadType } from 'src/providers/pdf/types/pdf-download-type';
import { LangType } from 'src/providers/translation/types/translation.type';
import { UserArticleReactionDto } from './dto/user-article-reaction.dto';
@UseInterceptors(UserAuthInterceptor)
@Controller('article')
export class ArticleController {
constructor(private readonly articleService: ArticleService) {}
@Post()
findAllArticles(@Req() req: RequestWithUserData, @Body() body: ArticleSearchDto): Promise<Array<Article>> {
return this.articleService.findAllArticles(req.user?.id, body);
}
}