diff --git a/app/components/dashboard/AdminDashboard.vue b/app/components/dashboard/AdminDashboard.vue index 349b7a1..b60eacf 100644 --- a/app/components/dashboard/AdminDashboard.vue +++ b/app/components/dashboard/AdminDashboard.vue @@ -18,7 +18,7 @@ const { data: statsRes, pending } = useAsyncData('admin-stats', () => getOvervie
-

{{ statsRes.data?.total_users || 0 }}

+

{{ statsRes.total_users || 0 }}

Utenti Registrati

@@ -28,7 +28,9 @@ const { data: statsRes, pending } = useAsyncData('admin-stats', () => getOvervie
-

{{ statsRes.data?.open_reports || 0 }}

+

+ {{ statsRes.open_reports ?? statsRes.reports_by_status?.find(s => s.status === 'OPEN')?.total ?? 0 }} +

Segn. Aperte

diff --git a/app/components/dashboard/CitizenDashboard.vue b/app/components/dashboard/CitizenDashboard.vue index 3307547..acd7bc4 100644 --- a/app/components/dashboard/CitizenDashboard.vue +++ b/app/components/dashboard/CitizenDashboard.vue @@ -82,7 +82,8 @@ const getStatusLabel = (status: string): string => { return labels[status] || status } -const formatDate = (dateString: string): string => { +const formatDate = (dateString?: string): string => { + if (!dateString) return '' return new Date(dateString).toLocaleDateString('it-IT', { day: '2-digit', month: '2-digit', year: '2-digit', }) diff --git a/app/components/dashboard/OperatorDashboard.vue b/app/components/dashboard/OperatorDashboard.vue index a3e222b..507f6ba 100644 --- a/app/components/dashboard/OperatorDashboard.vue +++ b/app/components/dashboard/OperatorDashboard.vue @@ -18,11 +18,11 @@ const handleTakeReport = async (id: number) => {

Da prendere in carico (OPEN)

-
+
Nessuna nuova segnalazione in ingresso.
@@ -40,11 +40,11 @@ const handleTakeReport = async (id: number) => {

Le mie assegnazioni

-
+
Non hai segnalazioni in carico.
diff --git a/app/pages/reports/[id].vue b/app/pages/reports/[id].vue index 6f68ced..aadf6ce 100644 --- a/app/pages/reports/[id].vue +++ b/app/pages/reports/[id].vue @@ -205,7 +205,7 @@ const formatDate = (dateString: string): string => {
- +
diff --git a/app/types/api.d.ts b/app/types/api.d.ts index 0812e1c..7acfe31 100644 --- a/app/types/api.d.ts +++ b/app/types/api.d.ts @@ -406,4 +406,6 @@ export interface OverviewStatsResponse { monthly_reports: { month: string; total: number }[]; avg_resolution_hours_by_category: { category: string; value: number }[]; avg_resolution_hours_by_area: { area: string; value: number }[]; + total_users?: number; + open_reports?: number; } \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index afdf876..eb4866c 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -17,7 +17,7 @@ export default defineNuxtConfig({ }, site: { - url: 'http://localhost:3000', + url: 'https://visione.studentindipendenti.it', name: 'Visione - Un\'occhio per la sicurezza del cittadino.', },