예제 #1
0
        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" }));
        }
예제 #2
0
        public IActionResult CreateToDoList([FromBody] ToDoListDTO toDoListDTO)
        {
            ToDoListDTO newListDTO = _service.CreateToDoList(toDoListDTO, User.GetEmail());

            return(CreatedAtAction(nameof(GetToDoList), new { id = newListDTO.Id }, newListDTO));
        }