Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 1
    you're not returning res from your getProtectedAsset function Commented Apr 7, 2022 at 13:42
  • "return res.data;" ??? Commented Apr 7, 2022 at 13:43
  • Yes you have to had a return at the end of your function getProtectedAsset -> return res Commented Apr 7, 2022 at 13:46
  • 1
    You are mixing async and .then. If you are awaiting async function, skip the then and catch and just return res in the same scope as you declare it. You are already catching using a try/catch block Commented Apr 7, 2022 at 13:48
  • first change res in to json before return Commented Apr 7, 2022 at 13:48