🐛 Fix wrong params name (skip instead of offset)
This commit is contained in:
@@ -52,24 +52,24 @@ public class SafetyService(AppDatabase db, ILogger<SafetyService> logger)
|
||||
.CountAsync();
|
||||
}
|
||||
|
||||
public async Task<List<AbuseReport>> GetReports(int skip = 0, int take = 20, bool includeResolved = false)
|
||||
public async Task<List<AbuseReport>> GetReports(int offset = 0, int take = 20, bool includeResolved = false)
|
||||
{
|
||||
return await db.AbuseReports
|
||||
.Where(r => includeResolved || r.ResolvedAt == null)
|
||||
.OrderByDescending(r => r.CreatedAt)
|
||||
.Skip(skip)
|
||||
.Skip(offset)
|
||||
.Take(take)
|
||||
.Include(r => r.Account)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<AbuseReport>> GetUserReports(Guid accountId, int skip = 0, int take = 20, bool includeResolved = false)
|
||||
public async Task<List<AbuseReport>> GetUserReports(Guid accountId, int offset = 0, int take = 20, bool includeResolved = false)
|
||||
{
|
||||
return await db.AbuseReports
|
||||
.Where(r => r.AccountId == accountId)
|
||||
.Where(r => includeResolved || r.ResolvedAt == null)
|
||||
.OrderByDescending(r => r.CreatedAt)
|
||||
.Skip(skip)
|
||||
.Skip(offset)
|
||||
.Take(take)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
@@ -463,7 +463,7 @@ public class ChatRoomController(
|
||||
[HttpGet("{roomId:guid}/members")]
|
||||
public async Task<ActionResult<List<ChatMember>>> ListMembers(Guid roomId,
|
||||
[FromQuery] int take = 20,
|
||||
[FromQuery] int skip = 0,
|
||||
[FromQuery] int offset = 0,
|
||||
[FromQuery] bool withStatus = false,
|
||||
[FromQuery] string? status = null
|
||||
)
|
||||
@@ -518,7 +518,7 @@ public class ChatRoomController(
|
||||
|
||||
var members = await query
|
||||
.OrderBy(m => m.JoinedAt)
|
||||
.Skip(skip)
|
||||
.Skip(offset)
|
||||
.Take(take)
|
||||
.ToListAsync();
|
||||
members = await crs.LoadMemberAccounts(members);
|
||||
|
Reference in New Issue
Block a user