public async Task <IActionResult> UpdateLeadQuote(int quoteId, [FromBody] UpdateLeadQuoteRequest request) { var updateLeadQuoteCommand = new UpdateLeadQuoteCommand(quoteId, request); var result = await mediator.Send(updateLeadQuoteCommand); return(StatusCode((int)result.Code, result.Value)); }
/// <summary> /// Updates the lead quote. /// </summary> /// <param name="quoteId">The quote identifier.</param> /// <param name="request">The request.</param> /// <returns></returns> public async Task <APIResponse> UpdateLeadQuote(int quoteId, UpdateLeadQuoteRequest request) { try { var client = httpClientFactory.CreateClient(LeadServiceOperation.serviceName); var param = JsonConvert.SerializeObject(request); HttpContent contentPost = new StringContent(param, Encoding.UTF8, "application/json"); var response = await client.PutAsync(servicesConfig.Lead + LeadServiceOperation.UpdateLeadQuote(quoteId), contentPost); return(new APIResponse(response.StatusCode)); } catch (Exception ex) { logger.Error(ex, "Exception in method 'UpdateLeadQuote()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }
/// <summary> /// Initializes a new instance of the <see cref="UpdateLeadQuoteCommand"/> class. /// </summary> /// <param name="id">The identifier.</param> /// <param name="request">The request.</param> public UpdateLeadQuoteCommand(int id, UpdateLeadQuoteRequest request) { Id = id; Request = request; }
public async Task <IActionResult> UpdateLeadQuote(int quoteId, [FromBody] UpdateLeadQuoteRequest request) { var result = await leadService.UpdateLeadQuote(quoteId, request); return(StatusCode((int)result.Code, result.Value)); }