I have two controllers, A and B. The controller A has, among other functions, the ability to GET the information from a Module. Let's call this function getA.
I export the controller with:
module.exports = controllerA
And I try to use the information in the controller B first by importing controller A:
const a = require('controllerA')
However, when I try to get the information returned by "getA", it's either undefined or "anonymous".
How could I retrieve this information?
Further information
When I try to print by console the const a, I get the following error:
type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received type function ([AsyncFunction (anonymous...)
And when I try to do a console.log(a._id) it returns undefined
I'm not sure if this matters, but controllerA depends on the user token to retrieve the information (authorization headers, bearer token...)