Example #1
0
        public async Task <IActionResult> DeleteTopic([FromQuery] string topicName)
        {
            try
            {
                var isAuthenticated = User.Identity.IsAuthenticated;

                if (isAuthenticated)
                {
                    var currentLoggedUser = User.Identity.Name;
                    return(Ok(await _topicServices.DeleteTopic(topicName, currentLoggedUser)));
                }
                else
                {
                    return(BadRequest("Please Login!!"));
                }
            }
            catch (LoginException ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }