Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class CreateCatDto {
- readonly name: string;
- readonly age: number;
- readonly breed: string;
- }
- import { CreateCatDto } from './dto/create-cat.dto';
- Unexpected token (2:11)
- 1 | export class CreateCatDto {
- > 2 | readonly name: string;
- | ^
- 3 | readonly age: number;
- 4 | readonly breed: string;
- 5 | }
- import { Controller, Bind, Get, Post, Body, Res, HttpStatus } from '@nestjs/common';
- // import { CreateCatDto } from './dto/create-cat.dto';
- @Controller('cats')
- export class CatsController {
- @Post()
- @Bind(Res(), Body())
- async create(res, body, createCatDto) {
- console.log("createCatDto", createCatDto)
- res.status(HttpStatus.CREATED).send();
- }
- @Get()
- findAll() {
- return [];
- }
- }
Add Comment
Please, Sign In to add comment