diff options
| author | Michael <[email protected]> | 2017-05-07 10:13:26 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-07 10:13:26 -0400 |
| commit | e013a6e4bff26aa5ab611dba8c26131e3773eac7 (patch) | |
| tree | 3ef81c4d98461a780f78dab98d883a1734ac9e69 /Project-Unite/Controllers/GroupsController.cs | |
| parent | 5785c29e953e68b9cc0764ebe57feeee4fb6b8be (diff) | |
| download | project-unite-e013a6e4bff26aa5ab611dba8c26131e3773eac7.tar.gz project-unite-e013a6e4bff26aa5ab611dba8c26131e3773eac7.tar.bz2 project-unite-e013a6e4bff26aa5ab611dba8c26131e3773eac7.zip | |
fix join and leave group
Diffstat (limited to 'Project-Unite/Controllers/GroupsController.cs')
| -rw-r--r-- | Project-Unite/Controllers/GroupsController.cs | 6 |
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); |
