Make it possible to gather values using scoped ItemConfiguration
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ConfirmUpdateItemHandler(IDecoratorService<Item<(Guid, string)>> store,
|
||||
public class ConfirmUpdateItemHandler(IDecoratorService<Item<(Guid, string)>> decoratorItem,
|
||||
IDecoratorService<ItemConfiguration> decoratorItemConfiguration,
|
||||
IMediator mediator,
|
||||
IPublisher publisher) :
|
||||
INotificationHandler<ConfirmEventArgs<Item>>
|
||||
@@ -14,17 +15,16 @@ public class ConfirmUpdateItemHandler(IDecoratorService<Item<(Guid, string)>> st
|
||||
|
||||
if (name is not null)
|
||||
{
|
||||
|
||||
|
||||
var dd = decoratorItemConfiguration;
|
||||
publisher.Publish(Notify.As(new ItemHeader<string>(name)));
|
||||
if (store?.Value is Item<(Guid, string)> item)
|
||||
if (decoratorItem?.Value is Item<(Guid, string)> item)
|
||||
{
|
||||
(Guid id, string _) = item.Value;
|
||||
|
||||
Item<(Guid, string)> newItem = new((id, name));
|
||||
publisher.Publish(Modified.As(item, newItem));
|
||||
|
||||
store.Set(newItem);
|
||||
decoratorItem.Set(newItem);
|
||||
|
||||
await mediator.Handle<UpdateEventArgs<(Guid, string, ItemConfiguration)>, bool>(new UpdateEventArgs<(Guid, string,
|
||||
ItemConfiguration)>((id, name, new ItemConfiguration())));
|
||||
|
||||
Reference in New Issue
Block a user