summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers/BlogController.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-07 21:16:57 -0400
committerMichael <[email protected]>2017-04-07 21:16:57 -0400
commitec14b58351280b503e706944c2af2306dce6d922 (patch)
tree911e146fd0b8254967e901f81bb214913164c7c8 /Project-Unite/Controllers/BlogController.cs
parentb1e6d3dee9fa6519c65dd7564eac02b9e68bc3ce (diff)
downloadproject-unite-ec14b58351280b503e706944c2af2306dce6d922.tar.gz
project-unite-ec14b58351280b503e706944c2af2306dce6d922.tar.bz2
project-unite-ec14b58351280b503e706944c2af2306dce6d922.zip
Fix error with liking/disliking of blogs.
Diffstat (limited to 'Project-Unite/Controllers/BlogController.cs')
-rw-r--r--Project-Unite/Controllers/BlogController.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Project-Unite/Controllers/BlogController.cs b/Project-Unite/Controllers/BlogController.cs
index d1aa0f9..15591df 100644
--- a/Project-Unite/Controllers/BlogController.cs
+++ b/Project-Unite/Controllers/BlogController.cs
@@ -33,7 +33,7 @@ namespace Project_Unite.Controllers
var uid = User.Identity.GetUserId();
if (topic == null)
return new HttpStatusCodeResult(404);
- if (topic.EditHistory.OrderBy(x => x.EditedAt).First().UserId == User.Identity.GetUserId())
+ if (topic.AuthorId == User.Identity.GetUserId())
return RedirectToAction("Index", new { id = id, triedtolikeowntopic = true });
var like = db.Likes.Where(x => x.Topic == topic.Id).FirstOrDefault(x => x.User == uid);
if (like != null)
@@ -69,7 +69,7 @@ namespace Project_Unite.Controllers
var uid = User.Identity.GetUserId();
if (topic == null)
return new HttpStatusCodeResult(404);
- if (topic.EditHistory.OrderBy(x => x.EditedAt).First().UserId == User.Identity.GetUserId())
+ if (topic.AuthorId == User.Identity.GetUserId())
return RedirectToAction("Index", new { id = id, triedtolikeowntopic = true });
var like = db.Likes.Where(x => x.Topic == topic.Id).FirstOrDefault(x => x.User == uid);
if (like != null)