Skip to content

Commit 7912e31

Browse files
Merge pull request #1295 from aaron5670/patch-1
Fixed incorrect JavaScript code example
2 parents 97673ce + bd8f558 commit 7912e31

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

content/controllers.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,37 +442,38 @@ export class CatsController {
442442
}
443443
}
444444
@@switch
445-
import { Controller, Get, Query, Post, Body, Put, Param, Delete } from '@nestjs/common';
445+
import { Controller, Get, Query, Post, Body, Put, Param, Delete, Bind } from '@nestjs/common';
446446
447447
@Controller('cats')
448448
export class CatsController {
449449
@Post()
450450
@Bind(Body())
451-
create(@Body() createCatDto) {
451+
create(createCatDto) {
452452
return 'This action adds a new cat';
453453
}
454454
455455
@Get()
456456
@Bind(Query())
457-
findAll(@Query() query) {
457+
findAll(query) {
458+
console.log(query);
458459
return `This action returns all cats (limit: ${query.limit} items)`;
459460
}
460461
461462
@Get(':id')
462463
@Bind(Param('id'))
463-
findOne(@Param('id') id) {
464+
findOne(id) {
464465
return `This action returns a #${id} cat`;
465466
}
466467
467468
@Put(':id')
468469
@Bind(Param('id'), Body())
469-
update(@Param('id') id, @Body() updateCatDto) {
470+
update(id, updateCatDto) {
470471
return `This action updates a #${id} cat`;
471472
}
472473
473474
@Delete(':id')
474475
@Bind(Param('id'))
475-
remove(@Param('id') id) {
476+
remove(id) {
476477
return `This action removes a #${id} cat`;
477478
}
478479
}

0 commit comments

Comments
 (0)