aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-02-27 11:18:09 +0200
committertranstrike <transtrike@gmail.com>2021-02-27 11:18:09 +0200
commit83ae76a1b93c91cf7cfb5fc9ea1ef728ee47c839 (patch)
tree78711c29342fc3d5b5e643403a507c9b030afa4d /src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
parent784b5fc621f71fa94eddf276b0b932ba7d1aa873 (diff)
downloadDevHive-83ae76a1b93c91cf7cfb5fc9ea1ef728ee47c839.tar
DevHive-83ae76a1b93c91cf7cfb5fc9ea1ef728ee47c839.tar.gz
DevHive-83ae76a1b93c91cf7cfb5fc9ea1ef728ee47c839.zip
JWT Validations works; Introduced more bugs to fix later
Diffstat (limited to 'src/Web/DevHive.Web/Controllers/ProfilePictureController.cs')
-rw-r--r--src/Web/DevHive.Web/Controllers/ProfilePictureController.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
new file mode 100644
index 0000000..d3971ff
--- /dev/null
+++ b/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Threading.Tasks;
+using DevHive.Services.Models.User;
+using DevHive.Web.Models.User;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace DevHive.Web.Controllers
+{
+ [ApiController]
+ [Route("api/[controller]")]
+ public class ProfilePictureController
+ {
+ [HttpPut]
+ [Route("ProfilePicture")]
+ [Authorize(Roles = "User,Admin")]
+ public async Task<IActionResult> UpdateProfilePicture(Guid userId, [FromForm] UpdateProfilePictureWebModel updateProfilePictureWebModel, [FromHeader] string authorization)
+ {
+ throw new NotImplementedException();
+ // if (!await this._userService.ValidJWT(userId, authorization))
+ // return new UnauthorizedResult();
+
+ // UpdateProfilePictureServiceModel updateProfilePictureServiceModel = this._userMapper.Map<UpdateProfilePictureServiceModel>(updateProfilePictureWebModel);
+ // updateProfilePictureServiceModel.UserId = userId;
+
+ // ProfilePictureServiceModel profilePictureServiceModel = await this._userService.UpdateProfilePicture(updateProfilePictureServiceModel);
+ // ProfilePictureWebModel profilePictureWebModel = this._userMapper.Map<ProfilePictureWebModel>(profilePictureServiceModel);
+
+ // return new AcceptedResult("UpdateProfilePicture", profilePictureWebModel);
+ }
+ }
+}