Skip to content

Commit

Permalink
removed unused endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Aug 21, 2013
1 parent 9e6dc8e commit b5c92d1
Showing 1 changed file with 1 addition and 55 deletions.
56 changes: 1 addition & 55 deletions MediaBrowser.Api/NotificationsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,7 @@ public class AddNotification : IReturn<Notification>
[ApiMember(Name = "Url", Description = "The notification's info url", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public string Url { get; set; }

[ApiMember(Name = "Category", Description = "The notification's category", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public string Category { get; set; }

[ApiMember(Name = "RelatedId", Description = "The notification's related id (item)", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public string RelatedId { get; set; }

[ApiMember(Name = "Level", Description = "The notification level", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public NotificationLevel Level { get; set; }
}

[Route("/Notifications/{UserId}/{Id}", "POST")]
[Api(Description = "Updates a notifications")]
public class UpdateNotification : IReturnVoid
{
[ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
public Guid UserId { get; set; }

[ApiMember(Name = "Id", Description = "Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public Guid Id { get; set; }

[ApiMember(Name = "Name", Description = "The notification's name", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string Name { get; set; }

[ApiMember(Name = "Description", Description = "The notification's description", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string Description { get; set; }

[ApiMember(Name = "Url", Description = "The notification's info url", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public string Url { get; set; }

[ApiMember(Name = "Category", Description = "The notification's category", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
[ApiMember(Name = "Category", Description = "The notification's category", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public string Category { get; set; }

[ApiMember(Name = "RelatedId", Description = "The notification's related id (item)", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
Expand Down Expand Up @@ -129,13 +100,6 @@ public object Post(AddNotification request)
return ToOptimizedResult(task.Result);
}

public void Post(UpdateNotification request)
{
var task = UpdateNotification(request);

Task.WaitAll(task);
}

public object Get(GetNotificationsSummary request)
{
var result = _notificationsRepo.GetNotificationsSummary(request.UserId);
Expand Down Expand Up @@ -163,24 +127,6 @@ private async Task<Notification> AddNotification(AddNotification request)
return notification;
}

private Task UpdateNotification(UpdateNotification request)
{
var notification = _notificationsRepo.GetNotification(request.Id, request.UserId);

notification.Description = request.Description;
notification.Level = request.Level;
notification.Url = request.Url;

notification.Date = DateTime.UtcNow;

notification.RelatedId = request.RelatedId;
notification.Category = request.Category;

notification.Name = request.Name;

return _notificationsRepo.UpdateNotification(notification, CancellationToken.None);
}

public void Post(MarkRead request)
{
var task = MarkRead(request.Ids, request.UserId, true);
Expand Down

0 comments on commit b5c92d1

Please sign in to comment.