import { create } from 'axios'; import { ref } from 'vue'; import DashboardData = App.Features.Dashboard.Data.DashboardData; export default function useDashboardViewModel() { const isLoading = ref(false); const dashboardData = ref(); function getDashboardData() { isLoading.value = true; const client = create(); client .get('/api/energy-prices') .then((res) => { dashboardData.value = res.data; }) .finally(() => (isLoading.value = false)); } return { isLoading, dashboardData, getDashboardData }; }