Ejemplo n.º 1
0
        public IActionResult CreateNewForumMessage([FromBody] ForumMessageInputModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            return(Ok(_forumAppService.CreateNewMessageForum(model)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// New Notification
        /// </summary>
        /// <param name="notification"></param>
        /// <returns></returns>
        public ResponseViewModel NewNotification(ForumMessageInputModel notification)
        {
            notification.ForumMessageTypeId = (int)ForumMessageTypeEnum.NOTIFICATION;

            var response = _forumAppService.CreateNewMessageForum(notification);

            _ = SendNotification(new NotificationInputModel
            {
                Notification = new Notification
                {
                    Title = notification.Title,
                    Body  = notification.Message,
                },

                RegistrationIds = notification.Receivers
            }).Result;

            return(response);
        }