예제 #1
0
  public void updateTask() {
    if (taskService.taskExists(task.getId())) {
      taskService.mergeTask(task);
      log.info("Task was updated successfully: {}", task.getLabel());

      this.hasTaskEditable = false;
    } else {
      log.error("Cannot update task. It is not in the list: {}", task.getLabel());
    }
  }
예제 #2
0
  public void removeTask() {
    if (hasNewTask) {
      this.hasNewTask = false;
    }

    if (taskService.taskExists(task.getId())) {
      taskService.removeTask(task);
      log.info("Task was removed successfully: {}", task.getLabel());

      this.hasTaskEditable = false;
    } else {
      log.error("Cannot remove task. It is not in the list: {}", task.getLabel());
    }
  }