Closed pavel-voronin closed 3 years ago
It's very convenient to use ES6's Object Destructuring in controllers:
... public async register({ request: { requestBody: { username, password }, }, response, }: HttpContextContract) { await UserService.create({ username, password }) response.status(204) } ...
typings/Request.d.ts:
typings/Request.d.ts
declare module '@ioc:Adonis/Core/Request' { export interface RequestContract { requestBody: Record<string, any> } }
No
Not something I would like to add to the core. However, you can add it using getters and macros. https://docs.adonisjs.com/guides/request#extending-request-class
Why this feature is required (specific use-cases will be appreciated)?
It's very convenient to use ES6's Object Destructuring in controllers:
Have you tried any other work arounds?
typings/Request.d.ts
:Are you willing to work on it with little guidance?
No