first commit
This commit is contained in:
29
src/modules/likes/likes.controller.ts
Normal file
29
src/modules/likes/likes.controller.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { CurrentUser } from '../../common/decorators/current-user.decorator';
|
||||
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
|
||||
import { CreateLikeDto } from './dto/create-like.dto';
|
||||
import { LikesService } from './likes.service';
|
||||
|
||||
@ApiTags('likes')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Controller('likes')
|
||||
export class LikesController {
|
||||
constructor(private readonly likesService: LikesService) {}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Like or dislike a user' })
|
||||
createLike(
|
||||
@CurrentUser('id') userId: string,
|
||||
@Body() dto: CreateLikeDto,
|
||||
) {
|
||||
return this.likesService.createLike(userId, dto);
|
||||
}
|
||||
|
||||
@Get('matches')
|
||||
@ApiOperation({ summary: 'Get my matches' })
|
||||
getMyMatches(@CurrentUser('id') userId: string) {
|
||||
return this.likesService.getMyMatches(userId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user