diff options
| -rw-r--r-- | Project-Unite/Controllers/APIController.cs | 8 | ||||
| -rw-r--r-- | Project-Unite/Views/Admin/Index.cshtml | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/APIController.cs b/Project-Unite/Controllers/APIController.cs index 5767586..f21a385 100644 --- a/Project-Unite/Controllers/APIController.cs +++ b/Project-Unite/Controllers/APIController.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Script.Serialization; +using Microsoft.AspNet.Identity; using Project_Unite.Models; namespace Project_Unite.Controllers @@ -47,6 +48,13 @@ namespace Project_Unite.Controllers } [Authorize] + public ActionResult TestNotification() + { + NotificationDaemon.NotifyEveryone(User.Identity.GetUserId(), "Test notification", "This is a test of the real-time notification system.", "#"); + return Content("Sent."); + } + + [Authorize] public ActionResult GetNotificationCount() { return Content(ACL.NotificationCountRaw(User.Identity.Name).ToString()); diff --git a/Project-Unite/Views/Admin/Index.cshtml b/Project-Unite/Views/Admin/Index.cshtml index d282f60..78404a1 100644 --- a/Project-Unite/Views/Admin/Index.cshtml +++ b/Project-Unite/Views/Admin/Index.cshtml @@ -5,3 +5,5 @@ <p>Wow, an actual index page.</p> +<button class="btn btn-default" onclick="$.ajax({url:'/API/TestNotification'})">Send test notification.</button> + |
