Beispiel #1
0
        public async Task <ActionResult> AddAScollingNewsMessage(ScrollNewsPostDto scrollNewsInput)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var num = await _newsRepo.AddAScrollNewsItem(scrollNewsInput);

            if (num < 1)
            {
                _logger.LogError("In cnews controller, addScrollnews returned nothing from repo");
                return(BadRequest("The Scrolling message was not added."));
            }
            var confirm = _conf.ConfirmResponse(true, "A Scrolling message has been added successfully.");

            return(Ok(confirm));
        }