Closed jfbelisle closed 3 years ago
That’s the old signature, please check the docs for inject usage
Ok, but if I do it this way:
router.get('/', inject(({ getAllEmplois }) => this.all));
all(req, res, next) {
const { getAllEmplois } = req;
const { SUCCESS, ERROR } = getAllEmplois.outputs;
...
getAllEmplois doesn't get resolved
Inject no longer sets anything on req. Use the factory function to return an inline handler and capture the dependency.
Hi,
I'm trying to inject my middleware function as per your example, https://github.com/talyssonoc/node-api-boilerplate/blob/adce807fdd36ac86a44965d0327ec06b9e803225/src/interfaces/http/user/UsersController.js
But I get this error message": "build: expected targetOrResolver to be a function or class, but got. ....",
This is how I registered it
And in my controller:
Am I missing something?
Thank you