|
|
@ -2,6 +2,7 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NzbDrone.Api.ClientSchema;
|
|
|
|
using NzbDrone.Api.ClientSchema;
|
|
|
|
|
|
|
|
using NzbDrone.Api.Mapping;
|
|
|
|
using NzbDrone.Api.REST;
|
|
|
|
using NzbDrone.Api.REST;
|
|
|
|
using NzbDrone.Core.Notifications;
|
|
|
|
using NzbDrone.Core.Notifications;
|
|
|
|
using Omu.ValueInjecter;
|
|
|
|
using Omu.ValueInjecter;
|
|
|
@ -47,11 +48,10 @@ namespace NzbDrone.Api.Notifications
|
|
|
|
notification = _notificationService.Create(notification);
|
|
|
|
notification = _notificationService.Create(notification);
|
|
|
|
notificationResource.Id = notification.Id;
|
|
|
|
notificationResource.Id = notification.Id;
|
|
|
|
|
|
|
|
|
|
|
|
var responseResource = new NotificationResource();
|
|
|
|
var response = notification.InjectTo<NotificationResource>();
|
|
|
|
responseResource.InjectFrom(notification);
|
|
|
|
response.Fields = SchemaBuilder.GenerateSchema(notification.Settings);
|
|
|
|
responseResource.Fields = SchemaBuilder.GenerateSchema(notification.Settings);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return responseResource;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private NotificationResource Update(NotificationResource notificationResource)
|
|
|
|
private NotificationResource Update(NotificationResource notificationResource)
|
|
|
@ -60,11 +60,10 @@ namespace NzbDrone.Api.Notifications
|
|
|
|
notification.Id = notificationResource.Id;
|
|
|
|
notification.Id = notificationResource.Id;
|
|
|
|
notification = _notificationService.Update(notification);
|
|
|
|
notification = _notificationService.Update(notification);
|
|
|
|
|
|
|
|
|
|
|
|
var responseResource = new NotificationResource();
|
|
|
|
var response = notification.InjectTo<NotificationResource>();
|
|
|
|
responseResource.InjectFrom(notification);
|
|
|
|
response.Fields = SchemaBuilder.GenerateSchema(notification.Settings);
|
|
|
|
responseResource.Fields = SchemaBuilder.GenerateSchema(notification.Settings);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return responseResource;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DeleteNotification(int id)
|
|
|
|
private void DeleteNotification(int id)
|
|
|
|