aboutsummaryrefslogtreecommitdiff
path: root/src/Web
diff options
context:
space:
mode:
Diffstat (limited to 'src/Web')
-rw-r--r--src/Web/DevHive.Web/Controllers/FriendsController.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Web/DevHive.Web/Controllers/FriendsController.cs b/src/Web/DevHive.Web/Controllers/FriendsController.cs
index 00d70a4..9f3ec13 100644
--- a/src/Web/DevHive.Web/Controllers/FriendsController.cs
+++ b/src/Web/DevHive.Web/Controllers/FriendsController.cs
@@ -34,7 +34,9 @@ namespace DevHive.Web.Controllers
if (!this._jwtService.ValidateToken(userId, authorization))
return new UnauthorizedResult();
- return null;
+ return (await this._friendsService.AddFriend(userId, friendId)) ?
+ new OkResult() :
+ new BadRequestResult();
}
[HttpDelete]
@@ -44,7 +46,9 @@ namespace DevHive.Web.Controllers
if (!this._jwtService.ValidateToken(userId, authorization))
return new UnauthorizedResult();
- return null;
+ return (await this._friendsService.RemoveFriend(userId, friendId)) ?
+ new OkResult() :
+ new BadRequestResult();
}
}
}