mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 19:31:47 -05:00
Delete likes from topics.
This commit is contained in:
parent
bcb75147a7
commit
cd9437be6d
1 changed files with 6 additions and 2 deletions
|
@ -175,7 +175,9 @@ public void DeleteTopic(ForumTopic topic)
|
||||||
{
|
{
|
||||||
DeletePost(post);
|
DeletePost(post);
|
||||||
}
|
}
|
||||||
db.ForumTopics.Remove(topic);
|
string id = topic.Id;
|
||||||
|
db.Likes.RemoveRange(db.Likes.Where(x => x.Topic == id));
|
||||||
|
db.ForumTopics.Remove(db.ForumTopics.FirstOrDefault(x=>x.Id==id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult AccessControl()
|
public ActionResult AccessControl()
|
||||||
|
@ -225,7 +227,9 @@ public ActionResult SetPermission(string id, string role, string permission)
|
||||||
|
|
||||||
public void DeletePost(ForumPost post)
|
public void DeletePost(ForumPost post)
|
||||||
{
|
{
|
||||||
db.ForumPosts.Remove(post);
|
string id = post.Id;
|
||||||
|
|
||||||
|
db.ForumPosts.Remove(db.ForumPosts.FirstOrDefault(x=>x.Id==id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue