aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/NotificationsController.cs
diff options
context:
space:
mode:
authorZadenRB <zaden.ruggieroboune@gmail.com>2020-04-22 10:00:10 -0600
committerZadenRB <zaden.ruggieroboune@gmail.com>2020-04-22 10:00:10 -0600
commit7693cc0db006ef4eb3a90d161b14ac4551bb96a7 (patch)
treebab02dc92c9c5a2552ae64f1ec241665db78623d /Jellyfin.Api/Controllers/NotificationsController.cs
parent2a49b19a7c02f16cd4bb1d847c1ff76c5df316fb (diff)
Use ActionResult return type for all endpoints
Diffstat (limited to 'Jellyfin.Api/Controllers/NotificationsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/NotificationsController.cs28
1 files changed, 16 insertions, 12 deletions
diff --git a/Jellyfin.Api/Controllers/NotificationsController.cs b/Jellyfin.Api/Controllers/NotificationsController.cs
index bb9f5a7b3..0bf3aa1b4 100644
--- a/Jellyfin.Api/Controllers/NotificationsController.cs
+++ b/Jellyfin.Api/Controllers/NotificationsController.cs
@@ -43,8 +43,8 @@ namespace Jellyfin.Api.Controllers
/// <param name="limit">An optional limit on the number of notifications returned.</param>
/// <returns>A read-only list of all of the user's notifications.</returns>
[HttpGet("{UserID}")]
- [ProducesResponseType(typeof(NotificationResultDto), StatusCodes.Status200OK)]
- public NotificationResultDto GetNotifications(
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public ActionResult<NotificationResultDto> GetNotifications(
[FromRoute] string userId,
[FromQuery] bool? isRead,
[FromQuery] int? startIndex,
@@ -59,8 +59,8 @@ namespace Jellyfin.Api.Controllers
/// <param name="userId">The user's ID.</param>
/// <returns>Notifications summary for the user.</returns>
[HttpGet("{UserID}/Summary")]
- [ProducesResponseType(typeof(NotificationsSummaryDto), StatusCodes.Status200OK)]
- public NotificationsSummaryDto GetNotificationsSummary(
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public ActionResult<NotificationsSummaryDto> GetNotificationsSummary(
[FromRoute] string userId)
{
return new NotificationsSummaryDto();
@@ -71,8 +71,8 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <returns>All notification types.</returns>
[HttpGet("Types")]
- [ProducesResponseType(typeof(IEnumerable<NotificationTypeInfo>), StatusCodes.Status200OK)]
- public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public ActionResult<IEnumerable<NotificationTypeInfo>> GetNotificationTypes()
{
return _notificationManager.GetNotificationTypes();
}
@@ -82,10 +82,10 @@ namespace Jellyfin.Api.Controllers
/// </summary>
/// <returns>All notification services.</returns>
[HttpGet("Services")]
- [ProducesResponseType(typeof(IEnumerable<NameIdPair>), StatusCodes.Status200OK)]
- public IEnumerable<NameIdPair> GetNotificationServices()
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ public ActionResult<IEnumerable<NameIdPair>> GetNotificationServices()
{
- return _notificationManager.GetNotificationServices();
+ return _notificationManager.GetNotificationServices().ToList();
}
/// <summary>
@@ -97,7 +97,7 @@ namespace Jellyfin.Api.Controllers
/// <param name="level">The level of the notification.</param>
[HttpPost("Admin")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public void CreateAdminNotification(
+ public ActionResult CreateAdminNotification(
[FromQuery] string name,
[FromQuery] string description,
[FromQuery] string? url,
@@ -114,6 +114,8 @@ namespace Jellyfin.Api.Controllers
};
_notificationManager.SendNotification(notification, CancellationToken.None);
+
+ return Ok();
}
/// <summary>
@@ -123,10 +125,11 @@ namespace Jellyfin.Api.Controllers
/// <param name="ids">A comma-separated list of the IDs of notifications which should be set as read.</param>
[HttpPost("{UserID}/Read")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public void SetRead(
+ public ActionResult SetRead(
[FromRoute] string userId,
[FromQuery] string ids)
{
+ return Ok();
}
/// <summary>
@@ -136,10 +139,11 @@ namespace Jellyfin.Api.Controllers
/// <param name="ids">A comma-separated list of the IDs of notifications which should be set as unread.</param>
[HttpPost("{UserID}/Unread")]
[ProducesResponseType(StatusCodes.Status200OK)]
- public void SetUnread(
+ public ActionResult SetUnread(
[FromRoute] string userId,
[FromQuery] string ids)
{
+ return Ok();
}
}
}