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

@Body argument decorator fails with multiple named arguments #21

Closed
Jephery opened this issue May 3, 2017 · 2 comments
Closed

@Body argument decorator fails with multiple named arguments #21

Jephery opened this issue May 3, 2017 · 2 comments

Comments

@Jephery
Copy link

Jephery commented May 3, 2017

Only the first @Body argument decorator returns the expected result.
Repeated uses return undefined results.

Example:

@Controller("auth")
export class AuthorizationController {

    @Post()
    authenticate(@Request() req: Req,
                 @Response() res: Res,
                 @Body("user") user: string,
                 @Body("password") password: string)
    {
        console.log(user);     // returns 'example_user'
        console.log(password); // returns 'undefined'
        console.dir(req.body); // returns { user: 'example_user', password: 'password' }
        res.sendStatus(HttpStatus.OK);
    }

}
@kamilmysliwiec
Copy link
Member

Hi @Jephery,
Thanks for the report.

Issue is fixed in 1.0.2 version. Please, update your package :)

@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants