mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 17:22:15 +00:00
Fix error with liking/disliking of blogs.
This commit is contained in:
parent
b1e6d3dee9
commit
ec14b58351
1 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ public ActionResult DislikePost(string id)
|
|||
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 @@ public ActionResult LikePost(string id)
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue