From b0c6c6e1795a1cc8fe82a60ce16a263ab4cad397 Mon Sep 17 00:00:00 2001 From: transtrike Date: Fri, 2 Apr 2021 23:53:11 +0300 Subject: ReadProfilePic endpoint implemented --- .../DevHive.Web/Controllers/ProfilePictureController.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Web/DevHive.Web/Controllers') 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 @@ -28,6 +28,20 @@ namespace DevHive.Web.Controllers this._profilePictureMapper = profilePictureMapper; } + /// + /// Get the URL of user's profile picture + /// + /// The profile picture's Id + /// JWT Bearer Token + /// The URL of the profile picture + [HttpGet] + [AllowAnonymous] + public async Task ReadProfilePicture(Guid profilePictureId, [FromHeader] string authorization) + { + string profilePicURL = await this._profilePictureService.GetProfilePictureById(profilePictureId); + return new OkObjectResult(new { ProfilePictureURL = profilePicURL} ); + } + /// /// Alter the profile picture of a user /// -- cgit v1.2.3