Skip to content

Commit

Permalink
🚧 post action
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobytes committed Mar 8, 2021
1 parent 36b2f60 commit 96691c5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/controllers/products.controller.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller, Get, Query, Param } from '@nestjs/common';
import { Controller, Get, Query, Param, Post, Body } from '@nestjs/common';

@Controller('products')
export class ProductsController {
Expand All @@ -8,7 +8,9 @@ export class ProductsController {
@Query('offset') offset = 0,
@Query('brand') brand: string,
) {
return `products limit=> ${limit} offset=> ${offset} brand=> ${brand}`;
return {
message: `products limit=> ${limit} offset=> ${offset} brand=> ${brand}`,
};
}

@Get('filter')
Expand All @@ -17,7 +19,15 @@ export class ProductsController {
}

@Get(':productId')
getProduct(@Param('productId') productId: string) {
getOne(@Param('productId') productId: string) {
return `product ${productId}`;
}

@Post()
create(@Body() payload: any) {
return {
message: 'accion de crear',
payload,
};
}
}

0 comments on commit 96691c5

Please sign in to comment.