Skip to content

Commit

Permalink
Fix deletion of projects that had last opened user file references
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgDangl committed Sep 5, 2024
1 parent 202d7c0 commit c83c86b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/IPA.Bcfier.App/Controllers/ProjectsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ public async Task<IActionResult> DeleteProjectAsync(Guid projectId)
}

_context.Projects.Remove(dbProject);

var lastOpenedFiles = await _context.LastOpenedUserFiles
.Where(f => f.ProjectId == projectId)
.ToListAsync();
_context.LastOpenedUserFiles.RemoveRange(lastOpenedFiles);

await _context.SaveChangesAsync();
return NoContent();
}
Expand Down

0 comments on commit c83c86b

Please sign in to comment.