agregar logs a sync Turso para diagnosticar guardado de HUs

This commit is contained in:
2026-05-27 18:25:18 -05:00
parent e905fa5712
commit 023d4694bd
+12 -2
View File
@@ -124,7 +124,9 @@ export const useWorkItemsStore = defineStore('workitems', () => {
}
async function syncHUsToTurso(projectId: number, hus: KappaUserStory[]) {
console.log(`[Alpha] Syncing ${hus.length} HUs to Turso for project ${projectId}`)
for (const hu of hus) {
try {
await tauriDb.saveUserStory({
id: hu.id ?? 0,
initiative_id: projectId,
@@ -140,12 +142,17 @@ export const useWorkItemsStore = defineStore('workitems', () => {
actual_hours: null,
assigned_to: null,
created_at: null,
}).catch(() => {})
})
} catch (e) {
console.error(`[Alpha] Failed to save HU ${hu.id}:`, e)
}
}
}
async function syncEpicsToTurso(projectId: number, epicsData: KappaEpicDevelopment[]) {
console.log(`[Alpha] Syncing ${epicsData.length} epics to Turso for project ${projectId}`)
for (const epic of epicsData) {
try {
await tauriDb.saveEpic({
id: epic.id,
initiative_id: projectId,
@@ -160,7 +167,10 @@ export const useWorkItemsStore = defineStore('workitems', () => {
end_date: null,
created_at: null,
updated_at: null,
}).catch(() => {})
})
} catch (e) {
console.error(`[Alpha] Failed to save epic ${epic.id}:`, e)
}
}
}