Blog comment comments

This commit is contained in:
Paul Schneider 2024-12-15 20:48:04 +00:00
commit 1bde106195
10 changed files with 39 additions and 117 deletions

View file

@ -228,7 +228,8 @@ namespace Yavsc.Controllers
[ValidateAntiForgeryToken]
public IActionResult DeleteConfirmed(long id)
{
BlogPost blog = _context.Blogspot.Single(m => m.Id == id && m.GetOwnerId()== User.GetUserId());
var uid = User.GetUserId();
BlogPost blog = _context.Blogspot.Single(m => m.Id == id && m.AuthorId == uid );
_context.Blogspot.Remove(blog);
_context.SaveChanges(User.GetUserId());