Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass employer role #384

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SFA.DAS.EmployerCommitmentsV2.Services.Approvals;
using System.Threading.Tasks;

namespace SFA.DAS.EmployerCommitmentsV2.Web.Controllers
{
[Route("{accountHashedId}/[controller]")]
public class TestController : Controller
{
[HttpGet]
[Authorize]
public async Task<IActionResult> Index([FromServices] IOuterApiClient outerApiClient)
{
var result = await outerApiClient.Get<ResponseRole>("Test/Call/Commitment");
return Ok(result);
}
}
public class ResponseRole
{
public string Role { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private void AddHeaders()

_httpClient.DefaultRequestHeaders.Add(SubscriptionKeyRequestHeaderKey, _config.SubscriptionKey);
_httpClient.DefaultRequestHeaders.Add(VersionRequestHeaderKey, "1");
_httpClient.DefaultRequestHeaders.Add("x-party", "Employer");
}

public async Task<TResponse> Post<TResponse>(string url, object data)
Expand Down