diff --git a/src/dotnet/APIView/APIViewWeb/Managers/APIRevisionsManager.cs b/src/dotnet/APIView/APIViewWeb/Managers/APIRevisionsManager.cs index 07e6533ae4a..bed7f310142 100644 --- a/src/dotnet/APIView/APIViewWeb/Managers/APIRevisionsManager.cs +++ b/src/dotnet/APIView/APIViewWeb/Managers/APIRevisionsManager.cs @@ -72,7 +72,13 @@ public APIRevisionsManager( /// public async Task> GetAPIRevisionsAsync(ClaimsPrincipal user, PageParams pageParams, APIRevisionsFilterAndSortParams filterAndSortParams) { - return await _apiRevisionsRepository.GetAPIRevisionsAsync(user, pageParams, filterAndSortParams); + var revisions = await _apiRevisionsRepository.GetAPIRevisionsAsync(user, pageParams, filterAndSortParams); + List upgradedList = []; + foreach (var item in revisions) + { + upgradedList.Add(await UpgradeAPIRevisionIfRequired(item)); + } + return new PagedList((IEnumerable)upgradedList, revisions.NoOfItemsRead, revisions.TotalCount, pageParams.PageSize); } /// @@ -85,6 +91,12 @@ public async Task> GetAPIRevisionsAsync(Clai public async Task> GetAPIRevisionsAsync(string reviewId, string packageVersion = "", APIRevisionType apiRevisionType = APIRevisionType.All) { var apiRevisions = await _apiRevisionsRepository.GetAPIRevisionsAsync(reviewId); + List upgradedList = []; + foreach (var item in apiRevisions) + { + upgradedList.Add(await UpgradeAPIRevisionIfRequired(item)); + } + apiRevisions = upgradedList; if (apiRevisionType != APIRevisionType.All) apiRevisions = apiRevisions.Where(r => r.APIRevisionType == apiRevisionType);