Added id ordering as postgres would return the last changed elements first which breaks pagination

This commit is contained in:
2025-07-24 20:24:00 +02:00
parent 431cdcb260
commit bdc4ad8265
10 changed files with 29 additions and 7 deletions

View File

@@ -40,6 +40,7 @@ public class NodeAllocationsController : Controller
var allocations = await AllocationRepository
.Get()
.OrderBy(x => x.Id)
.Skip(page * pageSize)
.Take(pageSize)
.Where(x => x.Node.Id == nodeId)

View File

@@ -39,6 +39,7 @@ public class NodesController : Controller
var count = await query.CountAsync();
var items = await query
.OrderBy(x => x.Id)
.Skip(page * pageSize)
.Take(pageSize)
.ToArrayAsync();

View File

@@ -43,6 +43,7 @@ public class ServerVariablesController : Controller
var variables = await VariableRepository
.Get()
.Where(x => x.Server.Id == serverId)
.OrderBy(x => x.Id)
.Skip(page * pageSize)
.Take(pageSize)
.ToArrayAsync();

View File

@@ -66,9 +66,9 @@ public class ServersController : Controller
.Include(x => x.Allocations)
.Include(x => x.Variables)
.Include(x => x.Star)
.OrderBy(x => x.Id)
.Skip(page * pageSize)
.Take(pageSize)
.OrderBy(x => x.Id)
.ToArrayAsync();
var mappedItems = items

View File

@@ -52,6 +52,7 @@ public class StarDockerImagesController : Controller
var count = await query.CountAsync();
var items = await query
.OrderBy(x => x.Id)
.Skip(page * pageSize)
.Take(pageSize)
.ToArrayAsync();

View File

@@ -49,6 +49,7 @@ public class StarVariablesController : Controller
var count = await query.CountAsync();
var items = await query
.OrderBy(x => x.Id)
.Skip(page * pageSize)
.Take(pageSize)
.ToArrayAsync();

View File

@@ -34,6 +34,7 @@ public class StarsController : Controller
var items = await StarRepository
.Get()
.OrderBy(x => x.Id)
.Skip(page * pageSize)
.Take(pageSize)
.ToArrayAsync();