summaryrefslogtreecommitdiff
path: root/Project-Unite
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-07 10:13:26 -0400
committerMichael <[email protected]>2017-05-07 10:13:26 -0400
commite013a6e4bff26aa5ab611dba8c26131e3773eac7 (patch)
tree3ef81c4d98461a780f78dab98d883a1734ac9e69 /Project-Unite
parent5785c29e953e68b9cc0764ebe57feeee4fb6b8be (diff)
downloadproject-unite-e013a6e4bff26aa5ab611dba8c26131e3773eac7.tar.gz
project-unite-e013a6e4bff26aa5ab611dba8c26131e3773eac7.tar.bz2
project-unite-e013a6e4bff26aa5ab611dba8c26131e3773eac7.zip
fix join and leave group
Diffstat (limited to 'Project-Unite')
-rw-r--r--Project-Unite/Controllers/GroupsController.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Project-Unite/Controllers/GroupsController.cs b/Project-Unite/Controllers/GroupsController.cs
index d171d98..55b23b6 100644
--- a/Project-Unite/Controllers/GroupsController.cs
+++ b/Project-Unite/Controllers/GroupsController.cs
@@ -86,7 +86,8 @@ namespace Project_Unite.Controllers
public ActionResult JoinGroup(string id)
{
var db = new ApplicationDbContext();
- var user = db.Users.FirstOrDefault(x => x.Id == User.Identity.GetUserId());
+ string UserId = User.Identity.GetUserId();
+ var user = db.Users.FirstOrDefault(x => x.Id == UserId);
var group = db.Groups.FirstOrDefault(x => x.Id == id);
if (group == null)
return new HttpStatusCodeResult(404);
@@ -99,7 +100,8 @@ namespace Project_Unite.Controllers
public ActionResult LeaveGroup()
{
var db = new ApplicationDbContext();
- var user = db.Users.FirstOrDefault(x => x.Id == User.Identity.GetUserId());
+ string UserId = User.Identity.GetUserId();
+ var user = db.Users.FirstOrDefault(x => x.Id == UserId);
var group = db.Groups.FirstOrDefault(x => x.Id == user.GroupId);
if (group == null)
return new HttpStatusCodeResult(404);