예제 #1
0
        public async Task RemoveAllowedTopicAsync(string appId, string userId, TopicId prefix, CancellationToken ct = default)
        {
            var command = new RemoveUserAllowedTopic
            {
                Prefix = prefix
            };

            await userStore.UpsertAsync(appId, userId, command, ct);

            await repository.UnsubscribeByPrefixAsync(appId, userId, prefix, ct);
        }
예제 #2
0
        public async Task AllowedTopicRemoveAsync(string appId, string userId, TopicId prefix, CancellationToken ct)
        {
            var command = new RemoveUserAllowedTopic
            {
                Prefix = prefix
            };

            await userStore.UpsertAsync(appId, userId, command, ct);

            await repository.DeletePrefixAsync(appId, userId, prefix, ct);
        }
예제 #3
0
        public async Task <IActionResult> DeleteAllowedTopic(string appId, string id, string prefix)
        {
            var user = await userStore.GetAsync(appId, id, HttpContext.RequestAborted);

            if (user == null)
            {
                return(NotFound());
            }

            var update = new RemoveUserAllowedTopic {
                Prefix = prefix
            };

            await userStore.UpsertAsync(appId, id, update, HttpContext.RequestAborted);

            return(NoContent());
        }