public async Task <IActionResult> UpdateOrderState( [FromForm] UpdateOrderStateInput input) { Result result = await _orderManager.UpdateOrderState(input); if (result.Success) { return(Ok(result)); } else { return(BadRequest(result)); } }
public async Task <Result> UpdateOrderState(UpdateOrderStateInput input) { Order order = await _orderRepository.FindAsync(input.OrderId); if (order == null) { return new Result() { Success = false } } ; order.RequestStatus = input.RequestStatus; order.Notification = input.Notification; await _orderRepository.UpdateAsync(order); return(new Result() { Success = true }); } }