1
This commit is contained in:
@@ -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, так как модели нет в схеме)
|
||||
|
||||
Reference in New Issue
Block a user