Beispiel #1
0
        public async Task <IActionResult> AddItemCategory(ItemCategory newCategory)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("ItemList"));
            }


            var currentUser = await _userManager.GetUserAsync(User);

            var itemList = await _todoItemListService.GetItemListById(currentUser, newCategory.ItemListId);

            if (currentUser == null)
            {
                return(Challenge());
            }
            var successful = await _todoItemService.AddNewItemCategoryAsync(newCategory, currentUser);

            return(RedirectToAction("ItemList", "Todo", itemList));
        }