причесывание
This commit is contained in:
@@ -44,7 +44,11 @@ public sealed class ListPartitionService(
|
||||
return Result.Fail<CurrentListPartitionDto>(new ValidationError(
|
||||
$"У типа заявки {requestTypeId} не настроен список SharePoint."));
|
||||
|
||||
var current = await registry.EnsureCurrentRegisteredAsync(requestType, cancellationToken);
|
||||
// Синтезируется на лету, не пишется в request_list_partitions — см.
|
||||
// ListPartitionRegistry.BuildCurrentAsync: строка появится там только когда
|
||||
// партиция реально станет архивом.
|
||||
var archived = await registry.GetArchivedAsync(requestType, cancellationToken);
|
||||
var current = await registry.BuildCurrentAsync(requestType, archived, cancellationToken);
|
||||
|
||||
var itemCount = await TryGetItemCountAsync(requestType.SiteUrl, requestType.ListId, cancellationToken);
|
||||
var queued = await TryEnqueueProvisioningAsync(requestType, current.Number, itemCount, cancellationToken);
|
||||
@@ -96,14 +100,15 @@ public sealed class ListPartitionService(
|
||||
if (string.IsNullOrWhiteSpace(requestType.ListId) || string.IsNullOrWhiteSpace(requestType.SiteUrl))
|
||||
return [];
|
||||
|
||||
await registry.EnsureCurrentRegisteredAsync(requestType, cancellationToken);
|
||||
var archived = await registry.GetArchivedAsync(requestType, cancellationToken);
|
||||
var current = await registry.BuildCurrentAsync(requestType, archived, cancellationToken);
|
||||
|
||||
return await db.RequestListPartitions.AsNoTracking()
|
||||
.Where(x => x.RequestTypeId == requestType.Id)
|
||||
.OrderBy(x => x.Number)
|
||||
.Select(x => new RequestListPartitionDto(
|
||||
x.Number, requestType.SiteUrl!, x.ListId, x.Title, x.ListId == requestType.ListId, x.CreatedAt))
|
||||
.ToListAsync(cancellationToken);
|
||||
var result = new List<RequestListPartitionDto>(archived.Count + 1);
|
||||
result.AddRange(archived.Select(x =>
|
||||
new RequestListPartitionDto(x.Number, requestType.SiteUrl!, x.ListId, x.Title, IsCurrent: false, x.CreatedAt)));
|
||||
result.Add(current);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user