feat: много запланированного
- клонирование коллекции - добавление паблик-коллекций - регенерация паблик-ссылок
This commit is contained in:
@@ -11,15 +11,18 @@ public sealed class SaveMediaCommandHandler : IRequestHandler<SaveMediaCommand,
|
||||
{
|
||||
private readonly IMediaItemRepository _mediaItems;
|
||||
private readonly ICollectionRepository _collections;
|
||||
private readonly IBotUserRepository _users;
|
||||
private readonly IUnitOfWork _uow;
|
||||
|
||||
public SaveMediaCommandHandler(
|
||||
IMediaItemRepository mediaItems,
|
||||
ICollectionRepository collections,
|
||||
IBotUserRepository users,
|
||||
IUnitOfWork uow)
|
||||
{
|
||||
_mediaItems = mediaItems;
|
||||
_collections = collections;
|
||||
_users = users;
|
||||
_uow = uow;
|
||||
}
|
||||
|
||||
@@ -38,9 +41,10 @@ public sealed class SaveMediaCommandHandler : IRequestHandler<SaveMediaCommand,
|
||||
}
|
||||
else
|
||||
{
|
||||
var inbox = await _collections.GetInboxAsync(request.OwnerTelegramId, cancellationToken)
|
||||
?? throw new DomainException("User inbox not found.");
|
||||
collectionId = inbox.Id;
|
||||
var user = await _users.GetByTelegramIdAsync(request.OwnerTelegramId, cancellationToken);
|
||||
if (user?.InboxCollectionId is null)
|
||||
throw new DomainException("User inbox not found.");
|
||||
collectionId = user.InboxCollectionId.Value;
|
||||
}
|
||||
|
||||
const int CollectionMediaLimit = 120;
|
||||
|
||||
Reference in New Issue
Block a user