aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Controllers/ProfilePictureController.cs
blob: d3971ff444424629f3aff1311179653b35d5b594 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);
		}
	}
}