コード例 #1
0
        public async Task <IActionResult> AddOnlineProfile([FromBody] OnlineProfile profile)
        {
            var userId = GetCurrentUserId();

            if (profile == null)
            {
                logger.LogInformation($"Call to {nameof(AddOnlineProfile)} with null input (user {userId})");
                return(BadRequest());
            }

            IEnumerable <OnlineProfile> profiles = await usersService.AddSocialProfile(profile, userId);

            return(Json(profiles.Select(x => x.ToPublic())));
        }