public IActionResult CreateChallenge(SendChallengeModel model) { try { _relogifyActorModel.PublishMessage( new ChallengeIssuedMessage(SendChallengeModel: model, TimeStamp: DateTime.UtcNow)); return(Ok()); } catch (Exception ex) { // TODO: Do not expose raw exception information return(BadRequest(ex.Message)); } }
public IActionResult SendChallenge(SendChallengeModel model) { if (!ModelState.IsValid) { return(View(model)); } _actorModel.PublishMessage( new ChallengeIssuedMessage(SendChallengeModel: model, TimeStamp: DateTime.UtcNow)); return(View(model with { RequestStatusMessage = "Challenge queued for sending" })); }
public void AcceptChallenge(int challengeId) => _relogifyActorModel.PublishMessage( new ChallengeAcceptedMessage(ChallengeEntryId: challengeId, TimeStamp: DateTime.UtcNow));