feat(dashboard): handle API errors and enhance translations

This commit is contained in:
2026-08-02 16:21:23 +02:00
parent 029c29afd1
commit fa66b416f3
16 changed files with 354 additions and 16 deletions
@@ -4,6 +4,7 @@ import DashboardData = App.Features.Dashboard.Data.DashboardData;
export default function useDashboardViewModel() {
const isLoading = ref<boolean>(false);
const error = ref<string>();
const dashboardData = ref<DashboardData>();
function getDashboardData() {
@@ -15,8 +16,11 @@ export default function useDashboardViewModel() {
.then((res) => {
dashboardData.value = res.data;
})
.catch((err) => {
error.value = err.response.data.message;
})
.finally(() => (isLoading.value = false));
}
return { isLoading, dashboardData, getDashboardData };
return { isLoading, dashboardData, error, getDashboardData };
}