Update doneStates of existing kanban cards (#625)

Signed-off-by: Ilya Sumbatyants <ilya.sumb@gmail.com>
This commit is contained in:
Ilya Sumbatyants
2021-12-14 14:33:30 +01:00
committed by GitHub
parent caff583483
commit 9d6e2f2076
6 changed files with 103 additions and 3 deletions
+14
View File
@@ -51,5 +51,19 @@ export const taskOperation: MigrateOperation = {
} else {
console.log('Task: => public project Kanban is ok')
}
const outdatedTasks = (await client.findAll(task.class.Task, {}))
.filter((x) => x.doneState === undefined)
await Promise.all(
outdatedTasks.map(async (task) => {
console.info('Upgrade task:', task._id)
try {
await ops.updateDoc(task._class, task.space, task._id, { doneState: null })
} catch (err: unknown) {
console.error(err)
}
})
)
}
}