Пример #1
0
        public async Task <IActionResult> SetMainPhoto(int userId, int id)
        {
            if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized());
            }

            var result = await _photoManager.SetMainPhoto(userId, id);

            if (!result.isValid)
            {
                return(BadRequest(result.Message));
            }

            return(NoContent());
        }