This commit is contained in:
tidusjar 2016-03-22 21:31:52 +00:00
parent 0585ff73ec
commit f64ccd7327
2 changed files with 24 additions and 3 deletions

View file

@ -25,6 +25,7 @@
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
@ -37,6 +38,7 @@ using Nancy.Security;
using PlexRequests.Api;
using PlexRequests.Core;
using PlexRequests.Core.SettingModels;
using PlexRequests.Services.Notification;
using PlexRequests.Store;
using PlexRequests.UI.Models;
@ -166,6 +168,17 @@ namespace PlexRequests.UI.Modules
var result = Service.UpdateRequest(originalRequest);
var model = new NotificationModel
{
User = Session[SessionKeys.UsernameKey].ToString(),
NotificationType = NotificationType.Issue,
Title = originalRequest.Title,
DateTime = DateTime.Now,
Body = issue == IssueState.Other ? comment : issue.Humanize()
};
NotificationService.Publish(model);
return Response.AsJson(result
? new JsonResponseModel { Result = true }
: new JsonResponseModel { Result = false, Message = "Could not add issue, please try again or contact the administrator!" });