Skip to content

Commit

Permalink
Merge pull request #974 from DFE-Digital/bugfix/spreadsheet-download-…
Browse files Browse the repository at this point in the history
…ab-dates

bugfix: download was not using local authority or advisory board date filters
  • Loading branch information
paullocknimble authored Jan 23, 2024
2 parents f62364a + 8042862 commit 1c1d2be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,18 @@ public async Task<ApiResponse<ProjectNote>> AddProjectNote(int id, AddProjectNot
: new ApiResponse<ProjectNote>(response.StatusCode, null);
}
public async Task<ApiResponse<FileStreamResult>> DownloadProjectExport(
int page,
int count,
string titleFilter = "",
IEnumerable<string> statusFilters = default,
IEnumerable<string> deliveryOfficerFilter = default,
IEnumerable<string> regionsFilter = default,
IEnumerable<string> applicationReferences = default)
int page,
int count,
string titleFilter = "",
IEnumerable<string> statusFilters = default,
IEnumerable<string> deliveryOfficerFilter = default,
IEnumerable<string> regionsFilter = default,
IEnumerable<string> localAuthoritiesFilter = default,
IEnumerable<string> advisoryBoardDatesFilter = default)
{
AcademyConversionSearchModelV2 searchModel = new() { TitleFilter = titleFilter, Page = page, Count = count };

ProcessFiltersV2(statusFilters, deliveryOfficerFilter, searchModel, regionsFilter, applicationReferences);
ProcessFiltersV2(statusFilters, deliveryOfficerFilter, searchModel, regionsFilter, localAuthoritiesFilter, advisoryBoardDatesFilter);

HttpResponseMessage response = await _apiClient.DownloadProjectExport(searchModel);
if (!response.IsSuccessStatusCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Task<ApiResponse<FileStreamResult>> DownloadProjectExport(
IEnumerable<string> statusFilters = default,
IEnumerable<string> deliveryOfficerFilter = default,
IEnumerable<string> regionsFilter = default,
IEnumerable<string> applicationReferences = default
IEnumerable<string> localAuthoritiesFilter = default,
IEnumerable<string> advisoryBoardDatesFilter = default
);

Task<ApiResponse<ApiV2Wrapper<IEnumerable<AcademyConversionProject>>>> GetAllProjectsV2(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task OnGetAsync()
public async Task<FileStreamResult> OnGetDownload()
{
Filters.PersistUsing(TempData).PopulateFrom(Request.Query);
ApiResponse<FileStreamResult> response = await _repository.DownloadProjectExport(CurrentPage, PageSize, Filters.Title, Filters.SelectedStatuses, Filters.SelectedOfficers, Filters.SelectedRegions);
ApiResponse<FileStreamResult> response = await _repository.DownloadProjectExport(CurrentPage, PageSize, Filters.Title, Filters.SelectedStatuses, Filters.SelectedOfficers, Filters.SelectedRegions, Filters.SelectedLocalAuthorities, Filters.SelectedAdvisoryBoardDates);

if (response.Success)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ public async Task<ApiResponse<FileStreamResult>> DownloadProjectExport(
IEnumerable<string> statusFilters = default,
IEnumerable<string> deliveryOfficerFilter = default,
IEnumerable<string> regionsFilter = default,
IEnumerable<string> applicationReferences = default
IEnumerable<string> localAuthoritiesFilter = default,
IEnumerable<string> advisoryBoardDatesFilter = default
)
{
return await _innerRepository.DownloadProjectExport(page, count, titleFilter, statusFilters, deliveryOfficerFilter, regionsFilter, applicationReferences);
return await _innerRepository.DownloadProjectExport(page, count, titleFilter, statusFilters, deliveryOfficerFilter, regionsFilter, localAuthoritiesFilter, advisoryBoardDatesFilter);
}
public async Task<ApiResponse<AcademyConversionProject>> GetProjectById(int id)
{
Expand Down

0 comments on commit 1c1d2be

Please sign in to comment.