public IActionResult CreateRequest([FromBody] AccountChangeRequest request) { var requestModel = request.ToAccountRequestModel(); var accountRequest = _accountRequestController.Create(requestModel); if (request != null) { var metadata = accountRequest.ToMetadata(); return(new ObjectResult(metadata)); } throw new Exception("Unable to create request"); }
public void SetValidatorRequestAprroval([FromBody] AccountChangeRequest request, [FromRoute] bool accept) { var requestModel = request.ToAccountRequestModel(); var accountRequest = _accountRequestController.Get(requestModel.PlayerId, requestModel.Region); if (accountRequest != null) { if (accept) { _accountRequestController.Update(requestModel.Region, requestModel); } _accountRequestController.Delete(accountRequest.Id); return; } throw new Exception($"No Request found for playerId {requestModel.PlayerId} and region {requestModel.Region}"); }