diff options
| author | transtrike <transtrike@gmail.com> | 2021-02-27 11:18:09 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2021-02-27 11:18:09 +0200 |
| commit | 83ae76a1b93c91cf7cfb5fc9ea1ef728ee47c839 (patch) | |
| tree | 78711c29342fc3d5b5e643403a507c9b030afa4d /src/Web/DevHive.Web/Controllers/ProfilePictureController.cs | |
| parent | 784b5fc621f71fa94eddf276b0b932ba7d1aa873 (diff) | |
| download | DevHive-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.cs | 32 |
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); + } + } +} |
