public IActionResult ApproveMaterial(int materialId, bool isRedirectToMaterial) { var loggedUser = _userService.FindByIdentityUserId(User.FindFirstValue(ClaimTypes.NameIdentifier)); var material = _materialsService.GetMaterial(materialId); if (material == null) { return(RedirectToAction("ResourceNotFound", "Error", new { error = "materiaĆ o podanym Id nie istnieje." })); } _materialsService.ApproveMaterial(material, loggedUser); if (isRedirectToMaterial) { return(RedirectToAction("Material", "Materials", new { area = "Main", materialId })); } return(RedirectToAction("MaterialsToApprove")); }