aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-04-02 23:53:11 +0300
committertranstrike <transtrike@gmail.com>2021-04-02 23:53:11 +0300
commitb0c6c6e1795a1cc8fe82a60ce16a263ab4cad397 (patch)
treeb82e15d10e28759dcd066b38ccdd16c23753b33c /src/Web/DevHive.Web
parentadff0d579e7e23fd78cce144b358f98737c91bcf (diff)
downloadDevHive-b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397.tar
DevHive-b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397.tar.gz
DevHive-b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397.zip
ReadProfilePic endpoint implemented
Diffstat (limited to 'src/Web/DevHive.Web')
-rw-r--r--src/Web/DevHive.Web/Controllers/ProfilePictureController.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
index 1c736f6..9a76e2c 100644
--- a/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
+++ b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
@@ -29,6 +29,20 @@ namespace DevHive.Web.Controllers
}
/// <summary>
+ /// Get the URL of user's profile picture
+ /// </summary>
+ /// <param name="profilePictureId">The profile picture's Id</param>
+ /// <param name="authorization">JWT Bearer Token</param>
+ /// <returns>The URL of the profile picture</returns>
+ [HttpGet]
+ [AllowAnonymous]
+ public async Task<IActionResult> ReadProfilePicture(Guid profilePictureId, [FromHeader] string authorization)
+ {
+ string profilePicURL = await this._profilePictureService.GetProfilePictureById(profilePictureId);
+ return new OkObjectResult(new { ProfilePictureURL = profilePicURL} );
+ }
+
+ /// <summary>
/// Alter the profile picture of a user
/// </summary>
/// <param name="userId">The user's Id</param>