Skip to content

Commit

Permalink
ER-813 - Added url for blocked employer for analytics purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjensenuk committed Oct 31, 2018
1 parent b5fb5b0 commit bb9e1e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Employer/Employer.Web/Configuration/Routing/RouteNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,7 @@ public static class RouteNames
public const string LevyDeclaration_Get = "LevyDeclaration_Get";
public const string LevyDeclaration_Post = "LevyDeclaration_Post";
public const string NonLevyInfo_Get = "NonLevyInfo_Get";

public const string BlockedEmployer_Get = "BlockedEmployer_Get";
}
}
5 changes: 3 additions & 2 deletions src/Employer/Employer.Web/Controllers/ErrorController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public IActionResult ErrorHandler()
if (exception is BlockedEmployerException)
{
_logger.LogInformation($"{exception.Message}. Path: {routeWhereExceptionOccurred}");
return BlockedEmployerAsync();
return RedirectToRoute(RouteNames.BlockedEmployer_Get, new { EmployerAccountId = accountId });
}
}

Expand All @@ -101,7 +101,8 @@ private IActionResult PageNotFound()
return View(ViewNames.PageNotFound);
}

private IActionResult BlockedEmployerAsync()
[HttpGet("error/blocked-employer/{employerAccountId}", Name = RouteNames.BlockedEmployer_Get)]
public IActionResult BlockedEmployer(string employerAccountId)
{
Response.StatusCode = (int)HttpStatusCode.Unauthorized;

Expand Down

0 comments on commit bb9e1e3

Please sign in to comment.