Closed dalssoft closed 3 years ago
Having a internal default controller is useful but forcing it is bad. There should be a way to override the default controller for certain use cases.
Suggested UX:
const myController = async (usecase, req, user, res, next, methodName) => { ... } const controllerList = [ { name: 'lists', idParameter: 'listId', getAll: require('../usecases/getLists'), // default internal controller getById: { usecase: require('../usecases/getLists'), controller: myController }, // my controller ... } ]
I created the customization for the controller and the addition of the name of the customized route parameter.
PR - https://github.com/herbsjs/herbs2rest/pull/11
great! tks!!
Having a internal default controller is useful but forcing it is bad. There should be a way to override the default controller for certain use cases.
Suggested UX: