diff --git a/src/SFA.DAS.EmployerFinance.Web/Orchestrators/TransfersOrchestrator.cs b/src/SFA.DAS.EmployerFinance.Web/Orchestrators/TransfersOrchestrator.cs index 712a10f799..fe7b85862f 100644 --- a/src/SFA.DAS.EmployerFinance.Web/Orchestrators/TransfersOrchestrator.cs +++ b/src/SFA.DAS.EmployerFinance.Web/Orchestrators/TransfersOrchestrator.cs @@ -30,12 +30,11 @@ public TransfersOrchestrator( public async Task> Index(string hashedAccountId) { - bool renderCreateTransfersPledgeButton = true; //await _authorizationService.IsAuthorizedAsync(EmployerUserRole.OwnerOrTransactor); + bool renderCreateTransfersPledgeButton = await _authorizationService.IsAuthorizedAsync(EmployerUserRole.OwnerOrTransactor); var accountId = _hashingService.DecodeValue(hashedAccountId); var pledgesCount = await _levyTransferMatchingService.GetPledgesCount(accountId); - var applicationsCount = await _levyTransferMatchingService.GetApplicationsCount(accountId); var viewModel = new OrchestratorResponse() { @@ -43,7 +42,6 @@ public async Task> Index(string ha { RenderCreateTransfersPledgeButton = renderCreateTransfersPledgeButton, PledgesCount = pledgesCount, - ApplicationsCount = applicationsCount } }; diff --git a/src/SFA.DAS.EmployerFinance.Web/ViewModels/TransfersIndexViewModel.cs b/src/SFA.DAS.EmployerFinance.Web/ViewModels/TransfersIndexViewModel.cs index 39039dd9fe..145b8b11dc 100644 --- a/src/SFA.DAS.EmployerFinance.Web/ViewModels/TransfersIndexViewModel.cs +++ b/src/SFA.DAS.EmployerFinance.Web/ViewModels/TransfersIndexViewModel.cs @@ -4,6 +4,5 @@ public class TransfersIndexViewModel { public bool RenderCreateTransfersPledgeButton { get; set; } public int PledgesCount { get; set; } - public int ApplicationsCount { get; set; } } } \ No newline at end of file diff --git a/src/SFA.DAS.EmployerFinance.Web/Views/Transfers/Index.cshtml b/src/SFA.DAS.EmployerFinance.Web/Views/Transfers/Index.cshtml index 806eb24691..f5d4fb7d94 100644 --- a/src/SFA.DAS.EmployerFinance.Web/Views/Transfers/Index.cshtml +++ b/src/SFA.DAS.EmployerFinance.Web/Views/Transfers/Index.cshtml @@ -24,18 +24,6 @@ View my transfer pledges and applications - -
-

Apply for transfers funding

-

Search transfers funding opportunities and apply for a transfer of funds.

-
- You have @Model.Data.ApplicationsCount transfer applications. -
- -
@section breadcrumb { diff --git a/src/SFA.DAS.EmployerFinance/Infrastructure/ApiClient.cs b/src/SFA.DAS.EmployerFinance/Infrastructure/ApiClient.cs index 0a4a99fc7e..44cc1d2a9b 100644 --- a/src/SFA.DAS.EmployerFinance/Infrastructure/ApiClient.cs +++ b/src/SFA.DAS.EmployerFinance/Infrastructure/ApiClient.cs @@ -18,12 +18,13 @@ public ApiClient ( { _httpClient = httpClient; _config = options; - _httpClient.BaseAddress = new Uri("https://localhost:44350/"); + _httpClient.BaseAddress = new Uri(_config.BaseUrl); } public async Task Get(IGetApiRequest request) { AddHeaders(); + var response = await _httpClient.GetAsync(request.GetUrl).ConfigureAwait(false); response.EnsureSuccessStatusCode(); diff --git a/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetApplicationsRequest.cs b/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetApplicationsRequest.cs deleted file mode 100644 index 6a7f158982..0000000000 --- a/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiRequests/GetApplicationsRequest.cs +++ /dev/null @@ -1,21 +0,0 @@ -using SFA.DAS.EmployerFinance.Interfaces.OuterApi; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SFA.DAS.EmployerFinance.Infrastructure.OuterApiRequests -{ - public class GetApplicationsRequest : IGetApiRequest - { - private readonly long _accountId; - - public GetApplicationsRequest(long accountId) - { - _accountId = accountId; - } - - public string GetUrl => $"Pledges?accountId={_accountId}"; - } -} diff --git a/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiResponses/GetApplicationsResponse.cs b/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiResponses/GetApplicationsResponse.cs deleted file mode 100644 index ca6546a924..0000000000 --- a/src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiResponses/GetApplicationsResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SFA.DAS.EmployerFinance.Infrastructure.OuterApiResponses -{ - public class GetApplicationsResponse - { - public int ApplicationsCount { get; set; } - } -} diff --git a/src/SFA.DAS.EmployerFinance/Services/ILevyTransferMatchingService.cs b/src/SFA.DAS.EmployerFinance/Services/ILevyTransferMatchingService.cs index 67969e7b60..c918657b6d 100644 --- a/src/SFA.DAS.EmployerFinance/Services/ILevyTransferMatchingService.cs +++ b/src/SFA.DAS.EmployerFinance/Services/ILevyTransferMatchingService.cs @@ -5,6 +5,5 @@ namespace SFA.DAS.EmployerFinance.Services public interface ILevyTransferMatchingService { Task GetPledgesCount(long accountId); - Task GetApplicationsCount(long accountId); } } \ No newline at end of file diff --git a/src/SFA.DAS.EmployerFinance/Services/LevyTransferMatchingService.cs b/src/SFA.DAS.EmployerFinance/Services/LevyTransferMatchingService.cs index c470e877bb..05a8f2d905 100644 --- a/src/SFA.DAS.EmployerFinance/Services/LevyTransferMatchingService.cs +++ b/src/SFA.DAS.EmployerFinance/Services/LevyTransferMatchingService.cs @@ -21,13 +21,5 @@ public async Task GetPledgesCount(long accountId) return getPledgesResponse.TotalPledges; } - - public async Task GetApplicationsCount(long accountId) - { - //var getApplicationsResponse = await _apiClient.Get(new GetApplicationsRequest(accountId)); - - //return getApplicationsResponse.ApplicationsCount; - return 2; - } } } \ No newline at end of file