I am new to NodeJs, and it looks like I miss something which is quite basic.
I created a controller, in order to simplify the problem here is the code:
export default class AuthController {
async register(ctx: HttpContext) {
const { email, name, password } = ctx.request.only(['email', 'name', 'password'])
:
:
}
async login(ctx: HttpContext) {
const { email, password } = ctx.request.only(['email', 'password'])
:
:
}
:
:
}
But I get an error:
the name `email` is defined multiple times
How should I solve this problem?