diff --git a/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/CreateNode/CreateNodeHandler.cs b/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/CreateNode/CreateNodeHandler.cs index d876d02..e991a29 100644 --- a/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/CreateNode/CreateNodeHandler.cs +++ b/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/CreateNode/CreateNodeHandler.cs @@ -1,9 +1,10 @@ +using BuildingBlocks.Application.Data; using BuildingBlocks.Domain.Nodes.Node.ValueObjects; using Nodes.Application.Data.Abstractions; namespace Nodes.Application.Entities.Nodes.Commands.CreateNode; -internal class CreateNodeHandler(INodesDbContext dbContext) : ICommandHandler +internal class CreateNodeHandler(INodesDbContext dbContext, ITimelinesService timelineService) : ICommandHandler { public async Task Handle(CreateNodeCommand command, CancellationToken cancellationToken) { @@ -12,6 +13,8 @@ public async Task Handle(CreateNodeCommand command, Cancellati dbContext.Nodes.Add(node); await dbContext.SaveChangesAsync(cancellationToken); + await timelineService.AddNode(node.TimelineId, node.Id, cancellationToken); + return new CreateNodeResult(node.Id); } }