diff --git a/app/composables/useAuth.ts b/app/composables/useAuth.ts index e9369ae..9b38c9d 100644 --- a/app/composables/useAuth.ts +++ b/app/composables/useAuth.ts @@ -71,7 +71,7 @@ export const useAuth = () => { const handleLoginSuccess = async (jwtToken: string) => { token.value = jwtToken tokenState.value = jwtToken - await syncUser({ redirectOnSuccess: true }) + await syncUser() window.location.reload(); } diff --git a/app/pages/admin/catalog.vue b/app/pages/admin/catalog.vue index 3632743..931aed7 100644 --- a/app/pages/admin/catalog.vue +++ b/app/pages/admin/catalog.vue @@ -12,7 +12,10 @@ const { createCategory, updateCategory, deleteCategory, createTeam, updateTeam, const { getCategories } = useReports() const { getTeams } = useOperator() -const { data: categoriesRes, refresh: refreshCategories } = await useAsyncData('report-categories-admin-view', () => getCategories()) +const { + data: categoriesRes, + refresh: refreshCategories +} = await useAsyncData('report-categories-admin-view', () => getCategories()) const { data: teamsRes, refresh: refreshTeams } = await useAsyncData('admin-teams', () => getTeams()) const { data: areasRes } = await useAsyncData('admin-team-areas', () => getAreas()) @@ -45,10 +48,10 @@ const categories = computed(() => categoriesRes.value?.categories || []) const teams = computed(() => teamsRes.value?.teams || []) const areas = computed(() => areasRes.value?.areas || []) const categoryDeleteMessage = computed(() => - categoryPendingDelete.value ? `Vuoi eliminare categoria "${categoryPendingDelete.value.name}"? Operazione irreversibile.` : '' + categoryPendingDelete.value ? `Vuoi eliminare categoria "${categoryPendingDelete.value.name}"? Operazione irreversibile.` : '' ) const teamDeleteMessage = computed(() => - teamPendingDelete.value ? `Vuoi eliminare team "${teamPendingDelete.value.name}"? Operazione irreversibile.` : '' + teamPendingDelete.value ? `Vuoi eliminare team "${teamPendingDelete.value.name}"? Operazione irreversibile.` : '' ) const resetCategoryForm = () => { @@ -236,7 +239,7 @@ const handleDeleteTeam = async () => {
- +
@@ -247,61 +250,65 @@ const handleDeleteTeam = async () => { {{ editingCategoryId ? 'Salva categoria' : 'Crea categoria' }}
- +
- - - - - - + + + + + + - - - - + + + - + - - - - + + + + + +
IDNomeStatoAzioni
IDNomeStatoAzioni
#{{ category.id }} - {{ category.name }} -
{{ category.description }}
-
+
#{{ category.id }} + {{ category.name }} +
{{ category.description }}
+
{{ category.active === false ? 'Inattiva' : 'Attiva' }} - - +
+ -
Nessuna categoria configurata.
Nessuna categoria configurata.
@@ -324,7 +331,7 @@ const handleDeleteTeam = async () => {
- +
@@ -346,18 +353,19 @@ const handleDeleteTeam = async () => {
- +
- @@ -365,55 +373,59 @@ const handleDeleteTeam = async () => {
- +
- - - - - - - - + + + + + + + + - - - - - - + + + + + - + - - - - + + + + + +
IDTeamCategoriaAreaStatoAzioni
IDTeamCategoriaAreaStatoAzioni
#{{ team.id }} - {{ team.name }} -
{{ team.description }}
-
{{ team.category_name || '-' }}{{ team.area_name || 'Tutte' }} +
#{{ team.id }} + {{ team.name }} +
{{ team.description }}
+
{{ team.category_name || '-' }}{{ team.area_name || 'Tutte' }} {{ team.active === false ? 'Inattivo' : 'Attivo' }} - - +
+ -
Nessun team configurato.
Nessun team configurato.
@@ -423,32 +435,43 @@ const handleDeleteTeam = async () => {
-