How do I return my result please,
I get an error
Can't find variable: convertToArray
I have a function in my api.js
export function apiGet() {
    return axios
    .get('http')
    .then(res => {
        const convertToArray = []
        for (const key in res.data) {
            convertToArray.push({ ...res.data[key], id: key })
            //console.log confirms my convertToArray has the info I expect in it
        }
        return convertToArray;
        })
        .catch(e => {
        console.log(e);
    })
    }
in my vuex store I have
  // Get list of cases
  loadCasess ({ commit, context }) {
    return new Promise ((resolve, reject) => {
      apiGet()
      resolve(commit('LIST_CASES', convertToArray))
      })
      .catch(e => {
        console.error(e)
       // reject('/')
      })
    },
 
    