Ejemplo n.º 1
0
 public async Task <IActionResult> ChangeIcon([FromForm] ChangeProfilePhoto viewModel)
 {
     return(await Validation_EmailConfirmation_ModelState(User, ModelState, async (user) =>
     {
         string extension = await photoManager.SaveProfilePhoto(user.Id, viewModel.File);
         if (extension != null)
         {
             if (userBehaviour.ChangeProfilePhotoPath(user, extension))
             {
                 return Ok();
             }
         }
         return Conflict("Could not save file.");
     }));
 }