public async Task AddUserRegistrationOrganizationAsync(IEnumerable <string> deviceIds, string organizationId) { if (!deviceIds.Any()) { return; } var tokenStateResponse = await HandleTokenStateAsync(); if (!tokenStateResponse) { return; } var requestModel = new PushUpdateRequestModel(deviceIds, organizationId); var message = new TokenHttpRequestMessage(requestModel, AccessToken) { Method = HttpMethod.Put, RequestUri = new Uri(string.Concat(PushClient.BaseAddress, "/push/add-organization")) }; try { await PushClient.SendAsync(message); } catch (Exception e) { _logger.LogError(12337, e, "Unable to add user org push registration."); } }
public async Task DeleteUserRegistrationOrganizationAsync(IEnumerable <string> deviceIds, string organizationId) { if (!deviceIds.Any()) { return; } var requestModel = new PushUpdateRequestModel(deviceIds, organizationId); await SendAsync(HttpMethod.Put, "push/delete-organization", requestModel); }
public async Task PutDeleteOrganization([FromBody] PushUpdateRequestModel model) { CheckUsage(); await _pushRegistrationService.DeleteUserRegistrationOrganizationAsync( model.DeviceIds.Select(d => Prefix(d)), Prefix(model.OrganizationId)); }