This commit is contained in:
2026-05-04 04:02:50 +05:00
parent 0c19af34c3
commit 4ddcaec7c8
6 changed files with 119 additions and 10 deletions
+6 -4
View File
@@ -29,10 +29,12 @@ export default defineEventHandler(async (event) => {
let completedTasks = 0
for (const canvas of canvases) {
const nodes = (canvas.nodes as any[]) || []
const tasks = nodes.filter(n => n.type === 'task')
totalTasks += tasks.length
completedTasks += tasks.filter(t => t.data?.state === 'completed' || t.state === 'completed').length
const nodes = canvas.nodes
if (Array.isArray(nodes)) {
const tasks = nodes.filter(n => n.type === 'task')
totalTasks += tasks.length
completedTasks += tasks.filter(t => (t.data?.state === 'completed' || t.state === 'completed')).length
}
}
// 3. Ачивки (пока возвращаем 0, так как модели нет в схеме)