Skip to content

Commit

Permalink
Remove unneeded routes (#5)
Browse files Browse the repository at this point in the history
* Remove unnecessary code

* Fixes #4

* Update products.http

Co-authored-by: Felipe Santos <felipecassiors@gmail.com>

Co-authored-by: Felipe Santos <felipecassiors@gmail.com>
  • Loading branch information
gustavoggsb and felipecrs authored Sep 30, 2020
1 parent be241cd commit 0d0d98d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions products.http
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@baseUrl = http://localhost:3000

# @name createProduct
POST {{baseUrl}}/products/create
POST {{baseUrl}}/products
Content-Type: application/json

{
Expand All @@ -13,7 +13,7 @@ Content-Type: application/json
###

@productId = {{createProduct.response.body._id}}
PUT {{baseUrl}}/products/update/{{productId}}
PUT {{baseUrl}}/products/{{productId}}
Content-Type: application/json

{
Expand All @@ -24,8 +24,8 @@ Content-Type: application/json

###

GET {{baseUrl}}/products/findById/{{productId}}
GET {{baseUrl}}/products/{{productId}}

###

Delete {{baseUrl}}/products/delete/{{productId}}
DELETE {{baseUrl}}/products/{{productId}}
8 changes: 4 additions & 4 deletions src/products/products.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ import {
export class ProductsController {
constructor(private service: ProductsService) {}

@Get('findById/:id')
@Get(':id')
get(@Param() params) {
return this.service.findById(params.id);
}

@Post('create')
@Post()
create(@Body() product: Product) {
return this.service.create(product);
}

@Put('update/:id')
@Put(':id')
update(@Param() params, @Body() product: Product) {
return this.service.update(params.id, product);
}

@Delete('delete/:id')
@Delete(':id')
remove(@Param() params) {
return this.service.remove(params.id);
}
Expand Down

0 comments on commit 0d0d98d

Please sign in to comment.