From 4b75aa68cfce409a889bef3790e4e033ba4a706d Mon Sep 17 00:00:00 2001 From: Hunor Tot-Bagi Date: Mon, 13 Jan 2025 16:32:04 +0100 Subject: [PATCH] chore: fix formatting & delete redundant empty lines --- .../Files/Commands/DeleteFileAsset/DeleteFileAssetHandler.cs | 1 - .../Entities/Nodes/Commands/DeleteNode/DeleteNodeHandler.cs | 1 - .../Entities/Notes/Commands/DeleteNote/DeleteNoteHandler.cs | 1 - .../Reminders/Commands/DeleteReminder/DeleteReminderHandler.cs | 1 - .../Timelines/Commands/DeleteTimeline/DeleteTimelineHandler.cs | 3 +-- 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Backend/src/Modules/Files/Files.Application/Entities/Files/Commands/DeleteFileAsset/DeleteFileAssetHandler.cs b/Backend/src/Modules/Files/Files.Application/Entities/Files/Commands/DeleteFileAsset/DeleteFileAssetHandler.cs index 5cd6443..7e02012 100644 --- a/Backend/src/Modules/Files/Files.Application/Entities/Files/Commands/DeleteFileAsset/DeleteFileAssetHandler.cs +++ b/Backend/src/Modules/Files/Files.Application/Entities/Files/Commands/DeleteFileAsset/DeleteFileAssetHandler.cs @@ -13,7 +13,6 @@ public async Task Handle(DeleteFileAssetCommand command, if (fileAsset is null) throw new FileAssetNotFoundException(command.FileAssetId); - dbContext.FileAssets.Remove(fileAsset); await dbContext.SaveChangesAsync(cancellationToken); diff --git a/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/DeleteNode/DeleteNodeHandler.cs b/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/DeleteNode/DeleteNodeHandler.cs index 2a5a03e..31454f5 100644 --- a/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/DeleteNode/DeleteNodeHandler.cs +++ b/Backend/src/Modules/Nodes/Nodes.Application/Entities/Nodes/Commands/DeleteNode/DeleteNodeHandler.cs @@ -13,7 +13,6 @@ public async Task Handle(DeleteNodeCommand command, Cancellati if (node is null) throw new NodeNotFoundException(command.NodeId); - dbContext.Nodes.Remove(node); await dbContext.SaveChangesAsync(cancellationToken); diff --git a/Backend/src/Modules/Notes/Notes.Application/Entities/Notes/Commands/DeleteNote/DeleteNoteHandler.cs b/Backend/src/Modules/Notes/Notes.Application/Entities/Notes/Commands/DeleteNote/DeleteNoteHandler.cs index 657d34f..69baba2 100644 --- a/Backend/src/Modules/Notes/Notes.Application/Entities/Notes/Commands/DeleteNote/DeleteNoteHandler.cs +++ b/Backend/src/Modules/Notes/Notes.Application/Entities/Notes/Commands/DeleteNote/DeleteNoteHandler.cs @@ -13,7 +13,6 @@ public async Task Handle(DeleteNoteCommand command, Cancellati if (note is null) throw new NoteNotFoundException(command.NoteId); - dbContext.Notes.Remove(note); await dbContext.SaveChangesAsync(cancellationToken); diff --git a/Backend/src/Modules/Reminders/Reminders.Application/Entities/Reminders/Commands/DeleteReminder/DeleteReminderHandler.cs b/Backend/src/Modules/Reminders/Reminders.Application/Entities/Reminders/Commands/DeleteReminder/DeleteReminderHandler.cs index 1c851ec..b34f19c 100644 --- a/Backend/src/Modules/Reminders/Reminders.Application/Entities/Reminders/Commands/DeleteReminder/DeleteReminderHandler.cs +++ b/Backend/src/Modules/Reminders/Reminders.Application/Entities/Reminders/Commands/DeleteReminder/DeleteReminderHandler.cs @@ -13,7 +13,6 @@ public async Task Handle(DeleteReminderCommand command, Ca if (reminder is null) throw new ReminderNotFoundException(command.ReminderId); - dbContext.Reminders.Remove(reminder); await dbContext.SaveChangesAsync(cancellationToken); diff --git a/Backend/src/Modules/Timelines/Timelines.Application/Entities/Timelines/Commands/DeleteTimeline/DeleteTimelineHandler.cs b/Backend/src/Modules/Timelines/Timelines.Application/Entities/Timelines/Commands/DeleteTimeline/DeleteTimelineHandler.cs index 39b4c64..e968f60 100644 --- a/Backend/src/Modules/Timelines/Timelines.Application/Entities/Timelines/Commands/DeleteTimeline/DeleteTimelineHandler.cs +++ b/Backend/src/Modules/Timelines/Timelines.Application/Entities/Timelines/Commands/DeleteTimeline/DeleteTimelineHandler.cs @@ -7,13 +7,12 @@ public class DeleteNodeHandler(ITimelinesDbContext dbContext) : ICommandHandler< public async Task Handle(DeleteTimelineCommand command, CancellationToken cancellationToken) { var timeline = await dbContext.Timelines - .AsNoTracking() + .AsNoTracking() .SingleOrDefaultAsync(t => t.Id == TimelineId.Of(Guid.Parse(command.TimelineId)), cancellationToken); if (timeline is null) throw new TimelineNotFoundException(command.TimelineId); - dbContext.Timelines.Remove(timeline); await dbContext.SaveChangesAsync(cancellationToken);