fix up/downvoting of contest entries

This commit is contained in:
Michael 2017-05-23 18:19:43 -04:00
parent e3aa2149da
commit 9226572231

View file

@ -87,6 +87,7 @@ public ActionResult Upvote(string id)
like.IsDislike = false; like.IsDislike = false;
like.User = uid; like.User = uid;
like.Topic = id; like.Topic = id;
db.Likes.Add(like);
} }
db.SaveChanges(); db.SaveChanges();
return RedirectToAction("ViewSubmission", new { id = id }); return RedirectToAction("ViewSubmission", new { id = id });
@ -115,6 +116,7 @@ public ActionResult Downvote(string id)
like.IsDislike = true; like.IsDislike = true;
like.User = uid; like.User = uid;
like.Topic = id; like.Topic = id;
db.Likes.Add(like);
} }
db.SaveChanges(); db.SaveChanges();
return RedirectToAction("ViewSubmission", new { id = id }); return RedirectToAction("ViewSubmission", new { id = id });