2

Recently I'm building a directus module extension with React. One of the functions of my extension is to retrieve directus items from DB. I tried using axios to get data but it didn't work out(it worked out using Postman). Is there other ways to retrieve directus items from directus extension? P.S. I run my directus locally

I wrote a function for fetching data as follows and nothing came out

async function getData() {

    try {

        const response = await axios.get('http://localhost:8055/items/level')

        return response.data

    }

    catch (err) {

        return err

    }

}
Or Assayag
  • 5,662
  • 13
  • 57
  • 93
Yun C
  • 21
  • 1

0 Answers0