too many changes
This commit is contained in:
+3
-1
@@ -12,7 +12,9 @@ public sealed class UpdateCollectionCommandHandler(
|
||||
public async Task<bool> Handle(UpdateCollectionCommand request, CancellationToken ct)
|
||||
{
|
||||
var collection = await collections.GetByIdAsync(request.CollectionId, ct);
|
||||
if (collection is null || collection.OwnerTelegramId != request.RequestingTelegramId)
|
||||
// Если коллекции нет или пользователь — не участник, возвращаем 404.
|
||||
// Если роль ниже Manager — domain.Rename() бросит DomainException.
|
||||
if (collection is null || collection.GetRole(request.RequestingTelegramId) is null)
|
||||
return false;
|
||||
|
||||
collection.Rename(request.Name, request.RequestingTelegramId);
|
||||
|
||||
Reference in New Issue
Block a user