Example #1
0
        public async Task <IActionResult> GetList(int id, [FromQuery] SortOrderViewModel sortOrderViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var list = await _toDoListService.GetListWithGoalsWithin(id);

            list.Sort(sortOrderViewModel);
            return(Ok(list));
        }
Example #2
0
        public async Task <IActionResult> GetAll([FromRoute] SmartLists smartListName, [FromQuery] SortOrderViewModel sortOrderViewModel, [FromQuery] bool uncompletedOnly = false)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var list = await _toDoListService.GetSmartList(smartListName, uncompletedOnly);

            list.Sort(sortOrderViewModel);
            return(Ok(list));
        }