public async Task <APIResponse> UpdateOrderlocations(int orderlocationId, UpdateOrderlocationRequest request) { try { var client = httpClientFactory.CreateClient(ECommerceServiceOperation.serviceName); var param = JsonConvert.SerializeObject(request); HttpContent contentPost = new StringContent(param, Encoding.UTF8, "application/json"); var response = await client.PutAsync(servicesConfig.ECommerce + ECommerceServiceOperation.UpdateOrderlocation(orderlocationId), contentPost); return(new APIResponse(response.StatusCode)); } catch (Exception ex) { logger.Error(ex, "Exception in method 'UpdateBranch()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }
public async Task <IActionResult> UpdateOrderlocations(int orderlocationId, [FromBody] UpdateOrderlocationRequest request) { var result = await orderlocationService.UpdateOrderlocations(orderlocationId, request); return(StatusCode((int)result.Code, result.Value)); }