public ActionResult ManualEvent(int userID, string feedMessage, int points) { var user = _userService.GetUser(userID); if (user != null) { _eventPublisher.ProcessManualEvent(feedMessage, user, points); } return(RedirectToAction("ManualEvent")); }
public ActionResult CreateManualEvent([FromBody] ManualEvent manualEvent) { if (!string.IsNullOrEmpty(manualEvent.EventDefinitionID)) { return(BadRequest("Can't specify an EventDefinitionID.")); } var user = _userService.GetUser(manualEvent.UserID); if (user == null) { return(BadRequest($"UserID {manualEvent.UserID} does not exist.")); } if (!manualEvent.Points.HasValue) { return(BadRequest("Point value required.")); } _eventPublisher.ProcessManualEvent(manualEvent.Message, user, manualEvent.Points.Value); return(Ok()); }