Untitled

 avatar
unknown
javascript
17 days ago
647 B
1
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')
  }
Leave a Comment