0

When i try to return data from function in service layer to controller layer i get "undefined".

On the other hand, when I implement the function in the controller everything works fine.

Service Function: enter image description here

Controller Function: enter image description here

The error from POSTMAN: enter image description here

When I implement the function just in the controller everything works fine and i get the data:

Controller Function: enter image description here

POSTMAN Result: enter image description here

Maor agai
  • 221
  • 1
  • 3
  • 11
  • 1
    The function `getStockFundsByName` isn't returning anything. (also, post code, not images of code) –  Dec 21 '20 at 19:14
  • The getStockFundsByName function returns data. So what is the problem? – Maor agai Dec 21 '20 at 19:23
  • 1
    @Maoragai No it does not. A callback *within* the function does, but not the function itself. You forgot `return fetch(...)`. You can find details in the duplicate question. – str Dec 21 '20 at 20:14
  • I do not believe, I didn't notice. Thank you so much ! – Maor agai Dec 21 '20 at 20:53

0 Answers0