public IActionResult CreateToDoList(ToDoListModel toDoListModel, int userId) { var result = _toDoListService.CreateToDoList(toDoListModel, userId); if (result) { return(Ok(new { message = "ToDoList created" })); } return(BadRequest(new { message = "Couldnt create list" })); }
public IActionResult CreateToDoList([FromBody] ToDoListDTO toDoListDTO) { ToDoListDTO newListDTO = _service.CreateToDoList(toDoListDTO, User.GetEmail()); return(CreatedAtAction(nameof(GetToDoList), new { id = newListDTO.Id }, newListDTO)); }