public async Task <IActionResult> ChangePriceAsync([FromBody] ChangePriceRequest model, CancellationToken token) { var command = new ChangeTutorPriceCommand(model.TutorId, model.Price); await _commandBus.DispatchAsync(command, token); return(Ok()); }
public async Task <IActionResult> ChangePriceAsync([FromBody] ChangePriceRequest model, CancellationToken token) { //if (model.Price < 0) //{ // ModelState.AddModelError(string.Empty, _localizer["PriceNeedToBeGreaterOrEqualZero"]); // return BadRequest(ModelState); //} var userId = _userManager.GetLongUserId(User); var command = new ChangeDocumentPriceCommand(model.Id, userId, model.Price); await _commandBus.DispatchAsync(command, token); return(Ok()); }