public IActionResult DeleteUserDevice([FromBody, BindRequired] DeleteDeviceToken body) { var user = this.DomainUser(); registry.RemoveToken( user.Id, DeviceId.From(body.DeviceId) ); return(NoContent()); }
public IActionResult UpdateUserDevice([FromBody, BindRequired] UpdateDeviceToken body) { var user = this.DomainUser(); registry.UpdateToken( user.Id, DeviceId.From(body.DeviceId), DeviceToken.From(body.Token) ); return(NoContent()); }
// TODO: when we may need to create a client in multiple controllers, // try to use custom model binders private static Client CreateClient(string registrationToken) => string.IsNullOrWhiteSpace(registrationToken) ? Client.New() : Client.New(DeviceId.From(registrationToken));