Replace tuple return types with named records
CLAUDE.md prohibits tuples as return types. Add PagedResult<T>, ProfileUpdateResult, and ApiKeyCreationResult records and update all callers (AuditLogQueryService, AdminIdentityService, UserService, ApiKeyService and their controllers/endpoints).
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using MicCheck.Api.Common;
|
||||
using MicCheck.Api.Data;
|
||||
using MicCheck.Api.Features;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -6,7 +7,7 @@ namespace MicCheck.Api.Identities;
|
||||
|
||||
public class AdminIdentityService(IMicCheckDbContext db)
|
||||
{
|
||||
public async Task<(int Total, IReadOnlyList<Identity> Items)> ListAsync(
|
||||
public async Task<PagedResult<Identity>> ListAsync(
|
||||
int environmentId, int page, int pageSize, CancellationToken ct = default)
|
||||
{
|
||||
var query = db.Identities
|
||||
@@ -20,7 +21,7 @@ public class AdminIdentityService(IMicCheckDbContext db)
|
||||
.Take(pageSize)
|
||||
.ToListAsync(ct);
|
||||
|
||||
return (total, items);
|
||||
return new PagedResult<Identity>(total, items);
|
||||
}
|
||||
|
||||
public async Task<Identity?> CreateAsync(int environmentId, string identifier, CancellationToken ct = default)
|
||||
|
||||
Reference in New Issue
Block a user