Added more magic to fancy. it now automatically figures our response for PUT and POST based on request ID.

file name sample uses HTTP GET instead of post
This commit is contained in:
kay.one 2013-08-25 22:14:55 -07:00
parent 438e3199de
commit 4188946395
20 changed files with 135 additions and 198 deletions

View file

@ -42,29 +42,17 @@ namespace NzbDrone.Api.Notifications
return result;
}
private NotificationResource Create(NotificationResource notificationResource)
private int Create(NotificationResource notificationResource)
{
var notification = GetNotification(notificationResource);
notification = _notificationService.Create(notification);
notificationResource.Id = notification.Id;
var response = notification.InjectTo<NotificationResource>();
response.Fields = SchemaBuilder.GenerateSchema(notification.Settings);
return response;
return _notificationService.Create(notification).Id;
}
private NotificationResource Update(NotificationResource notificationResource)
private void Update(NotificationResource notificationResource)
{
var notification = GetNotification(notificationResource);
notification.Id = notificationResource.Id;
notification = _notificationService.Update(notification);
var response = notification.InjectTo<NotificationResource>();
response.Fields = SchemaBuilder.GenerateSchema(notification.Settings);
return response;
_notificationService.Update(notification);
}
private void DeleteNotification(int id)