|
@@ -81,4 +81,25 @@ public class EventsController : ControllerBase
|
|
|
|
|
|
|
|
return Ok();
|
|
return Ok();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ [HttpPut("{id}/register")]
|
|
|
|
|
+ public ActionResult Register(string id, [FromBody] RegistrationState state)
|
|
|
|
|
+ {
|
|
|
|
|
+ var user = _requestRouter.For(ApiUser.Current.UserId).Process<UserProfile>();
|
|
|
|
|
+ var registration = _requestRouter
|
|
|
|
|
+ .For(new RegisterEvent(user, new ObjectId(id), state))
|
|
|
|
|
+ .Process<Registration>();
|
|
|
|
|
+
|
|
|
|
|
+ return Ok(registration);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [HttpGet("{id}/registrations")]
|
|
|
|
|
+ public ActionResult GetRegistrations(string id)
|
|
|
|
|
+ {
|
|
|
|
|
+ var registrations = _requestRouter
|
|
|
|
|
+ .For(new ObjectId(id))
|
|
|
|
|
+ .Process<IList<Registration>>();
|
|
|
|
|
+
|
|
|
|
|
+ return Ok(registrations);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|