public async Task <IActionResult> AddReward(AddRewardRequest request, CancellationToken cancellationToken) { var userProfileId = int.Parse(User.FindFirstValue(CustomClaimTypes.UserProfileIdentifier)); var command = new AddRewardCommand { Name = request.Name, PointsCost = request.PointsCost, RewardCategoryId = request.RewardCategoryId, UserProfileId = userProfileId }; var result = await _mediator.Send(command, cancellationToken); return(this.GetResponseFromResult(result)); }
public async Task <ActionResult <int> > Add(AddRewardCommand addRewardCommand) { return(Ok(await Mediator.Send(addRewardCommand))); }