public async Task <IActionResult> UpdateExerciseProperty(int id, int templateId) { RestRequest request = new RestRequest("exercise-property/" + id, Method.GET); IRestResponse <ExercisePropertyDto> response = await httpClientService.NewInstance(token) .ExecuteWithTimeoutExceptionAsync <ExercisePropertyDto>(request); ExercisePropertyUpdateViewModel model = mapper.Map <ExercisePropertyDto, ExercisePropertyUpdateViewModel>(response.Data); model.TrainingTemplateId = templateId; return(View(model)); }
public async Task <IActionResult> UpdateExerciseProperty(ExercisePropertyUpdateViewModel model) { if (!ModelState.IsValid) { return(View(model)); } RestRequest request = new RestRequest("exercise-property/update", Method.PUT); request.AddJsonBody(model as ExercisePropertyUpdateModel); IRestResponse <ExercisePropertyDto> response = await httpClientService.NewInstance(token) .ExecuteWithTimeoutExceptionAsync <ExercisePropertyDto>(request); return(Redirect("~/training/update/" + model.TrainingTemplateId)); }