import {
  Controller,
  Get,
  Post,
  Body,
  Param,
  Patch,
  Delete,
  ParseIntPipe,
} from '@nestjs/common';
import { CommentTypeService } from './comment-type.service';
import { CreateCommentTypeDto } from './dto/create-comment-type.dto';
import { UpdateCommentTypeDto } from './dto/update-comment-type.dto';

@Controller('comment-types')
export class CommentTypeController {
  constructor(private readonly service: CommentTypeService) {}

  @Post()
  create(@Body() dto: CreateCommentTypeDto) {
    return this.service.create(dto);
  }

  @Get()
  findAll() {
    return this.service.findAll();
  }

  @Get(':id')
  findOne(@Param('id', ParseIntPipe) id: number) {
    return this.service.findOne(id);
  }

  @Patch(':id')
  update(
    @Param('id', ParseIntPipe) id: number,
    @Body() dto: UpdateCommentTypeDto,
  ) {
    return this.service.update(id, dto);
  }

  @Delete(':id')
  remove(@Param('id', ParseIntPipe) id: number) {
    return this.service.remove(id);
  }
}
