summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-17 09:25:54 -0400
committerMichael <[email protected]>2017-04-17 09:25:54 -0400
commit58cdd0d4efde97f5f260d538940dc9c436c54e79 (patch)
tree65f1f76686623861e2ee59156cb9a49df2febe1e
parent41ced12e3b43ce74d022cc075f645f23cb6b94ec (diff)
downloadproject-unite-58cdd0d4efde97f5f260d538940dc9c436c54e79.tar.gz
project-unite-58cdd0d4efde97f5f260d538940dc9c436c54e79.tar.bz2
project-unite-58cdd0d4efde97f5f260d538940dc9c436c54e79.zip
add a test button
-rw-r--r--Project-Unite/Controllers/APIController.cs8
-rw-r--r--Project-Unite/Views/Admin/Index.cshtml2
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>
+