How to use the tsoa.Delete function in tsoa

To help you get started, we’ve selected a few tsoa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vietnam-devs / coolstore-microservices / src / services / catalog-typescript / src / controllers / productsController.ts View on Github external
* Create a user
   * @param request This is a user creation request description
   */
  @Post()
  public async Create(@Body() request: ProductCreateRequest): Promise {
    return {
      id: 'd831e238-94ae-44cb-8ed9-16d6addf5876',
      name: 'Product Name',
      desc: 'Product Description',
      price: 200.25,
      imageUrl: 'Image Url'
    }
  }

  /** Delete a user by ID */
  @Delete('{productId}')
  public async Delete(productId: number): Promise {
    return Promise.resolve()
  }
}
github MakingSense / tsoa-api / src / controllers / UserController.ts View on Github external
@Response(400, 'Bad request')
  @Security('admin')
  @Post()
  public async create(@Body() body: IUserModel): Promise {
    return this.service.create(body);
  }

  @Response(400, 'Bad request')
  @Security('admin')
  @Put('{id}')
  public async update(id: string, @Body() body: IUserModel): Promise {
    return this.service.update(id, body);
  }

  @Security('admin')
  @Delete('{id}')
  public async delete(id: string): Promise {
    return this.service.delete(id);
  }
}

tsoa

Build swagger-compliant REST APIs using TypeScript and Node

MIT
Latest version published 1 month ago

Package Health Score

95 / 100
Full package analysis