public async Task <IActionResult> PostMySubscriptions([FromBody] SubscribeManyDto request) { foreach (var dto in request.Subscribe.OrEmpty()) { var update = dto.ToUpdate(); await subscriptionStore.UpsertAsync(App.Id, UserId, dto.TopicPrefix, update, HttpContext.RequestAborted); } foreach (var topic in request.Unsubscribe.OrEmpty()) { await subscriptionStore.DeleteAsync(App.Id, UserId, topic, HttpContext.RequestAborted); } return(NoContent()); }
public async Task <IActionResult> PostSubscriptions(string appId, string id, [FromBody] SubscribeManyDto request) { var user = await userStore.GetAsync(appId, id, HttpContext.RequestAborted); if (user == null) { return(NotFound()); } foreach (var dto in request.Subscribe.OrEmpty()) { var update = dto.ToUpdate(); await subscriptionStore.UpsertAsync(appId, id, dto.TopicPrefix, update, HttpContext.RequestAborted); } foreach (var topic in request.Unsubscribe.OrEmpty()) { await subscriptionStore.DeleteAsync(appId, id, topic, HttpContext.RequestAborted); } return(NoContent()); }