public async Task <IActionResult> AddUserToCommunity(int community, [FromForm] AddCommunityCommand command) { /* * var user = await _userManager.GetUserAsync(User); * if (await _userManager.IsInRoleAsync(user, "Community_Admin")) * { * var action = new CheckUserInCommunity(user.Id, community); * var checkInCommunity = await Mediator.Send(action); //checks if * } */ await Mediator.Send(command); return(RedirectToAction("ManageCommunity", new { id = community })); }
public async Task <IActionResult> AddCommunity([FromBody] AddCommunityCommand command) { return(Ok(await Mediator.Send(command))); }