Skip to content

Commit

Permalink
Sorting broke
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Jun 21, 2024
1 parent e57a77d commit 9bf6c17
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public async Task<Paging<UserCrashReportModel>> GetCrashReportsPaginatedAsync(Ne
x.ModuleInfos.Any(y => moduleIds.Contains(y.Module.ModuleId)) ||
x.ModuleInfos.Where(y => y.NexusModsMod != null).Any(y => nexusModsModIds.Contains(y.NexusModsMod!.NexusModsModId)));

return await dbQuery.PaginatedGroupedAsync(query.Page, query.PageSize, ct);
//return await dbQuery.PaginatedGroupedAsync(query.Page, query.PageSize, ct);
return await dbQuery.PaginatedAsync(query.Page, query.PageSize, ct);
}
}
6 changes: 4 additions & 2 deletions src/BUTR.Site.NexusMods.Server/Repositories/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,14 @@ protected Repository(BaseAppDbContext dbContext)
.ToListAsync(ct);

public Task<Paging<TEntity>> PaginatedAsync(PaginatedQuery query, uint maxPageSize = 20, Sorting? defaultSorting = default, CancellationToken ct = default) => InternalQuery
.PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct);
//.PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct);
.PaginatedAsync(query, maxPageSize, defaultSorting, ct);

public Task<Paging<TProjection>> PaginatedAsync<TProjection>(Expression<Func<TEntity, TProjection>> projection, PaginatedQuery query, uint maxPageSize = 20, Sorting? defaultSorting = default, CancellationToken ct = default)
where TProjection : class => InternalQuery
.Select(projection)
.PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct);
//.PaginatedGroupedAsync(query, maxPageSize, defaultSorting, ct);
.PaginatedAsync(query, maxPageSize, defaultSorting, ct);


public virtual void Add(TEntity entity) => _dbContext.Set<TEntity>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public async Task<Paging<UserLinkedModModel>> GetNexusModsModsPaginatedAsync(Nex
});

return await availableModsByNexusModsModLinkage
.PaginatedGroupedAsync(query, 20, new() { Property = nameof(UserLinkedModModel.NexusModsModId), Type = SortingType.Ascending }, ct);
//.PaginatedGroupedAsync(query, 20, new() { Property = nameof(UserLinkedModModel.NexusModsModId), Type = SortingType.Ascending }, ct);
.PaginatedAsync(query, 20, new() { Property = nameof(UserLinkedModModel.NexusModsModId), Type = SortingType.Ascending }, ct);
}

public async Task<Paging<UserAvailableModModel>> GetAvailableModsPaginatedAsync(NexusModsUserId userId, PaginatedQuery query, CancellationToken ct)
Expand Down

0 comments on commit 9bf6c17

Please sign in to comment.