I made a fake api call to my json file with axios. I get a promise back from the function where i can get my data from. but i don't want that. I want to receive the data from the function.

my code now: products.js

```js
export default {
    getAllProducts(axios) {
        return axios.get('fakedb.json').then(response => {
            return response.data;
        });
    }
}

```

the view file: a product.vue file

```js
import productController from '~/data/controllers/product';
export default {
  data() {
    return {
      products: productController.getAllProducts(this.$axios).then(res => this.products = res)
    }
  },
}

```

but this is not what i want to achieve.
what i want to achieve is this code in my product.vue file:

```
import productController from '~/data/controllers/product';
export default {
  data() {
    return {
      products: productController.getAllProducts(this.$axios)
    }
  },
}

```

i want to receive the data without having to handle the promise in the view file. any solution how to return my data in the products.js file?

if i do a normal return from the products.js file like this it works fine:

```
export default {
    getAllProducts(axios) {
        return [
          {
              "name": "Product1",
               "price": 9.75
          },
          {
              "name": "Product2",
              "price": 10.75
          }
        ]

    }
}

```

But i want it to go with axios