public async Task <IActionResult> AddPlanItem(PlanItem item) { if (!ModelState.IsValid) { return(RedirectToAction("Index")); } var curUsr = await _usrMgr.GetUserAsync(User); if (curUsr == null) { return(Challenge()); } var successful = await _planeSrvc.AddPlanItemAsync(item, curUsr); if (!successful) { return(BadRequest("Could not add item.")); } return(RedirectToAction("Index")); }