Currently, the TodoApp is utilizing the Inquirer.js
module for questioning purposes. However, an issue has arisen with the error message stating
type checkbox is not assignable to type number
.
function promptComplete(): void{
console.clear();
inquirer.prompt({
type: "checkbox",
name: "complete",
message: "Mark Task Complete",
Choice: collection.getTodoItems(showCompleted).map(item=>({name:item.task, value:item.id, checked:item.complete}))
}).then(answers => {
let completedTasks = answers["complete"] as number[];
collection.getTodoItems(true).forEach(item =>
collection.markCompleted(item.id, completedTasks.find(id => id===item.id) != undefined));
promptUser();
})
}