public async Task <IActionResult> ConfirmNoReview(int requisitionId) { var requisition = await _dbContext.Requisitions.GetRequisitionById(requisitionId); if (ModelState.IsValid) { if ((await _authorizationService.AuthorizeAsync(User, requisition, Policies.Accept)).Succeeded) { try { await _requisitionService.ConfirmNoReview(requisition, User.GetUserId(), User.TryGetImpersonatorId()); } catch (InvalidOperationException ex) { _logger.LogError("ConfirmNoReview failed for requisition, RequisitionId: {requisition.RequisitionId}, message {Message}", requisition.RequisitionId, ex.Message); return(RedirectToAction("View", "Order", new { id = requisition.Request.OrderId, errormessage = ex.Message })); } return(RedirectToAction("Index", "Home", new { Message = "Rekvisitionen är nu arkiverad" })); } return(Forbid()); } return(RedirectToAction("View", "Order", new { id = requisition.Request.OrderId, tab = "requisition" })); }