I have a method does performs two API calls and stores them both in separate variables. I would like to be able to access those variables from another method in order to manipulate the data.
How can I access the data from another method in Vue.
Here is my api call:
async apiCall () {
const [result1, result2] =
await Promise.all([
get('lots/inputsOutputs', { locationId: '56464589a6d3b', fromDate: moment(this.dateRange[0]).format('YYYY-MM-DD'), toDate: moment(this.dateRange[1]).format('YYYY-MM-DD') }),
get('lots/inputsOutputs', { locationId: '5464564563ebd', fromDate: moment(this.dateRange[0]).format('YYYY-MM-DD'), toDate: moment(this.dateRange[1]).format('YYYY-MM-DD') })
]);
this.Loading = false;
return [result1, result2];
}