public async Task <IActionResult> Update([FromBody] EditSocialMediaDto model) { if (!ModelState.IsValid) { return(BadRequest(ModelState.Values.Select(x => x.Errors.FirstOrDefault().ErrorMessage))); } await _socialMediaService.EditSocialMedia(model); return(Ok()); }
public async Task <IActionResult> Put(string Url, [FromBody] EditSocialMediaDto model) { if (!ModelState.IsValid) { return(BadRequest(ModelState.Values.Select(x => x.Errors.FirstOrDefault().ErrorMessage))); } IdentityResult result = await _socialMediaService.EditSocialMedia(Url, model); if (result.Succeeded) { return(Ok(result)); } return(BadRequest(result.Errors.Select(x => x.Description))); }