diff --git a/BlogPlatform/Endpoints/Comment/UpdateCommentEndpoint.cs b/BlogPlatform/Endpoints/Comment/UpdateCommentEndpoint.cs index 9a809d9..43c3e6f 100644 --- a/BlogPlatform/Endpoints/Comment/UpdateCommentEndpoint.cs +++ b/BlogPlatform/Endpoints/Comment/UpdateCommentEndpoint.cs @@ -30,7 +30,6 @@ public class UpdateCommentEndpoint(BlogPlatformDbContext database) : Endpoint x.Id == req.Id, ct); + var post = await database.Posts + .Include(p => p.Comments) + .SingleOrDefaultAsync(x => x.Id == req.Id, ct); + var checkUser = await database.Users.SingleOrDefaultAsync(x => x.Id == req.UserId, ct); if (checkUser == null || post == null) @@ -24,11 +27,11 @@ public class UpdatePostEndpoint(BlogPlatformDbContext database) : Endpoint