Exemplo n.º 1
0
        private async Task <Response> ProposeTopic(string topicName)
        {
            if (topicName == null || topicName.Length > 20)
            {
                return(HttpStatusCode.BadRequest);
            }
            var curentUser  = Context.CurrentUser;
            var topicExists = await topicsManager.ProposedTopicExists(topicName);

            if (topicExists)
            {
                return(HttpStatusCode.Conflict);
            }
            await topicsManager.AddProposedTopic(topicName, curentUser.UserName);

            await notificationCore.SendProposedTopicNotification(curentUser.UserName, topicName);

            return(HttpStatusCode.OK);
        }