Skip to content

Commit

Permalink
Do paging in database, when viewing rollbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmania committed Oct 28, 2021
1 parent d0a0a0a commit ae20c49
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ public override IEnumerable<IContent> GetAllVersionsSlim(int nodeId, int skip, i
.OrderByDescending<ContentVersionDto>(x => x.Current)
.AndByDescending<ContentVersionDto>(x => x.VersionDate);

return MapDtosToContent(Database.Fetch<DocumentDto>(sql), true,
var pageIndex = skip / take;

return MapDtosToContent(Database.Page<DocumentDto>(pageIndex+1, take, sql).Items, true,
// load bare minimum, need variants though since this is used to rollback with variants
false, false, false, true).Skip(skip).Take(take);
false, false, false, true);
}

public override IContent GetVersion(int versionId)
Expand Down

0 comments on commit ae20c49

Please sign in to comment.