Added id ordering as postgres would return the last changed elements first which breaks pagination
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -34,6 +34,7 @@ public class StarsController : Controller
|
||||
|
||||
var items = await StarRepository
|
||||
.Get()
|
||||
.OrderBy(x => x.Id)
|
||||
.Skip(page * pageSize)
|
||||
.Take(pageSize)
|
||||
.ToArrayAsync();
|
||||
|
||||
Reference in New Issue
Block a user