Guest User

Untitled

a guest
Feb 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. export class CreateCatDto {
  2. readonly name: string;
  3. readonly age: number;
  4. readonly breed: string;
  5. }
  6.  
  7. import { CreateCatDto } from './dto/create-cat.dto';
  8.  
  9. Unexpected token (2:11)
  10. 1 | export class CreateCatDto {
  11. > 2 | readonly name: string;
  12. | ^
  13. 3 | readonly age: number;
  14. 4 | readonly breed: string;
  15. 5 | }
  16.  
  17. import { Controller, Bind, Get, Post, Body, Res, HttpStatus } from '@nestjs/common';
  18. // import { CreateCatDto } from './dto/create-cat.dto';
  19.  
  20. @Controller('cats')
  21. export class CatsController {
  22.  
  23. @Post()
  24. @Bind(Res(), Body())
  25. async create(res, body, createCatDto) {
  26. console.log("createCatDto", createCatDto)
  27. res.status(HttpStatus.CREATED).send();
  28. }
  29.  
  30. @Get()
  31. findAll() {
  32. return [];
  33. }
  34. }
Add Comment
Please, Sign In to add comment