Untitled
unknown
javascript
9 months ago
647 B
3
Indexable
function onAddTask ( group, initialTitle = 'New Task', fromHeader) {
const newTask = { id: utilService.makeId(), title: initialTitle }
addTask(board, group, newTask, fromHeader)
}
const onAddGroup = (fromHeader) => {
if (!board) return
let newGroup = boardService.getEmptyGroup()
newGroup = {
id: utilService.makeId(), // Generate and add ID to the top of the properties
...newGroup,
}
const updatedGroups = fromHeader ? [newGroup , ...board?.groups] : [...board?.groups, newGroup]
updateBoard(board, null, null, { key: 'groups', value: updatedGroups })
console.log(board, ' UPDATED BOARD')
}Editor is loading...
Leave a Comment