diff --git a/frontend/package.json b/frontend/package.json index 4c72089..a041182 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "checklist-frontend", "private": true, - "version": "1.0.66", + "version": "1.0.67", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index dbd0053..edab63e 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -233,7 +233,11 @@ function DashboardPage({ user, setUser }) { if (checklistsRes.ok) { const checklistsData = await checklistsRes.json() console.log('Checklists data:', checklistsData) - setChecklists(Array.isArray(checklistsData) ? checklistsData : []) + // Ordenar por ID descendente para mantener orden consistente + const sortedChecklists = Array.isArray(checklistsData) + ? checklistsData.sort((a, b) => b.id - a.id) + : [] + setChecklists(sortedChecklists) } else { console.error('Error loading checklists:', checklistsRes.status) setChecklists([]) @@ -251,7 +255,11 @@ function DashboardPage({ user, setUser }) { if (inspectionsRes.ok) { const inspectionsData = await inspectionsRes.json() console.log('Inspections data:', inspectionsData) - setInspections(Array.isArray(inspectionsData) ? inspectionsData : []) + // Ordenar por ID descendente para mantener orden consistente + const sortedInspections = Array.isArray(inspectionsData) + ? inspectionsData.sort((a, b) => b.id - a.id) + : [] + setInspections(sortedInspections) } else { console.error('Error loading inspections:', inspectionsRes.status) setInspections([])