From fd8b20362994020fcbfc4314c1bdc951a3e2b315 Mon Sep 17 00:00:00 2001 From: batuhancetin Date: Mon, 25 Dec 2023 22:50:03 +0300 Subject: [PATCH] my followings done --- app/backend/src/poll/poll.controller.ts | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/backend/src/poll/poll.controller.ts b/app/backend/src/poll/poll.controller.ts index b7d051f7..1cb14f54 100644 --- a/app/backend/src/poll/poll.controller.ts +++ b/app/backend/src/poll/poll.controller.ts @@ -544,6 +544,32 @@ export class PollController { }); } + @UseGuards(AuthGuard, VerificationGuard) + @ApiResponse({ + status: 200, + description: 'Polls are fetched successfully.', + type: [GetPollResponseDto], + }) + @ApiResponse({ + status: 500, + description: 'Internal server error, contact with backend team.', + }) + @Get('my-followings2') + public async findPollsOfUsersIFollow2(@Req() req: any): Promise { + const userId = req.user.id; + return await this.pollService.findAll({ + creatorId: null, + approveStatus: true, + likedById: null, + votedById: null, + followedById: userId, + sortString: null, + is_settled: null, + tags: null, + userId, + }); + } + @UseGuards(AuthGuard, VerificationGuard) @ApiQuery({ name: 'pageSize', required: true }) @ApiQuery({ name: 'pageNum', required: true })