public async Task <IActionResult> UpdateUserInterest([FromBody] UserInterestUpdateViewModel updateUserInterest) { var updatedUserInterest = await _userInterestService.Update(updateUserInterest); if (updatedUserInterest == null) { return(BadRequest("An Interest with the given Id does not exist")); } return(NoContent()); }
public async Task <UserInterest> Update(UserInterestUpdateViewModel updateUserInterest) { UserInterest existingUserInterest = await _userInterestRepository.GetById(updateUserInterest.Id); if (existingUserInterest == null) { return(null); } return(await _userInterestRepository.Update( _mapper.Map <UserInterest>(updateUserInterest))); }