Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I map a dataTransfereObject (DTO) directly to the type inside the function #103

Closed
ThorstenBux opened this issue Jul 11, 2019 · 2 comments

Comments

@ThorstenBux
Copy link

Example

  @Path('send')
  @POST
  public sendEmail(@Body() sendEmailDto: SendEmailDto) {
    //do something with the dto
  }

as opposed to

  @Path('send')
  @POST
  public sendEmail(@Param('from) from: string, @Param('to') to:string) {
    //do something with the values
  }
@alfonsoal1983
Copy link

Of course you can. Remove the @Body() tag.

public sendEmail(sendEmailDto: SendEmailDto)

And thats all.

@ThorstenBux
Copy link
Author

@alfonsoal1983 thanks for answering. Yes, I've found that shortly after posting but forgot about the post. Closing it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants