agregar logs a sync Turso para diagnosticar guardado de HUs
This commit is contained in:
+12
-2
@@ -124,7 +124,9 @@ export const useWorkItemsStore = defineStore('workitems', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function syncHUsToTurso(projectId: number, hus: KappaUserStory[]) {
|
async function syncHUsToTurso(projectId: number, hus: KappaUserStory[]) {
|
||||||
|
console.log(`[Alpha] Syncing ${hus.length} HUs to Turso for project ${projectId}`)
|
||||||
for (const hu of hus) {
|
for (const hu of hus) {
|
||||||
|
try {
|
||||||
await tauriDb.saveUserStory({
|
await tauriDb.saveUserStory({
|
||||||
id: hu.id ?? 0,
|
id: hu.id ?? 0,
|
||||||
initiative_id: projectId,
|
initiative_id: projectId,
|
||||||
@@ -140,12 +142,17 @@ export const useWorkItemsStore = defineStore('workitems', () => {
|
|||||||
actual_hours: null,
|
actual_hours: null,
|
||||||
assigned_to: null,
|
assigned_to: null,
|
||||||
created_at: null,
|
created_at: null,
|
||||||
}).catch(() => {})
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`[Alpha] Failed to save HU ${hu.id}:`, e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function syncEpicsToTurso(projectId: number, epicsData: KappaEpicDevelopment[]) {
|
async function syncEpicsToTurso(projectId: number, epicsData: KappaEpicDevelopment[]) {
|
||||||
|
console.log(`[Alpha] Syncing ${epicsData.length} epics to Turso for project ${projectId}`)
|
||||||
for (const epic of epicsData) {
|
for (const epic of epicsData) {
|
||||||
|
try {
|
||||||
await tauriDb.saveEpic({
|
await tauriDb.saveEpic({
|
||||||
id: epic.id,
|
id: epic.id,
|
||||||
initiative_id: projectId,
|
initiative_id: projectId,
|
||||||
@@ -160,7 +167,10 @@ export const useWorkItemsStore = defineStore('workitems', () => {
|
|||||||
end_date: null,
|
end_date: null,
|
||||||
created_at: null,
|
created_at: null,
|
||||||
updated_at: null,
|
updated_at: null,
|
||||||
}).catch(() => {})
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`[Alpha] Failed to save epic ${epic.id}:`, e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user