aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/NotificationsController.cs
diff options
context:
space:
mode:
authorPatrick Barron <18354464+barronpm@users.noreply.github.com>2020-08-07 18:08:12 +0000
committerGitHub <noreply@github.com>2020-08-07 18:08:12 +0000
commita15be774ac606ec71f3ab0849a56ae08b8cc2f4d (patch)
tree590a56ca843635f9e353b598b1182d84bf6a9bd4 /Jellyfin.Api/Controllers/NotificationsController.cs
parent34cf1b17574e68734e7e4394cda28f5b2a36edcf (diff)
parente735ab6cc0faaec61d6aceeb0b946ba94a8c103c (diff)
Merge pull request #3833 from crobibero/api-cleanup-v3
api-migration review fixes
Diffstat (limited to 'Jellyfin.Api/Controllers/NotificationsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/NotificationsController.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Jellyfin.Api/Controllers/NotificationsController.cs b/Jellyfin.Api/Controllers/NotificationsController.cs
index 1bb39b5f7..cf3e780b4 100644
--- a/Jellyfin.Api/Controllers/NotificationsController.cs
+++ b/Jellyfin.Api/Controllers/NotificationsController.cs
@@ -1,13 +1,16 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading;
+using Jellyfin.Api.Constants;
using Jellyfin.Api.Models.NotificationDtos;
using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Notifications;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Notifications;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -16,6 +19,7 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// The notification controller.
/// </summary>
+ [Authorize(Policy = Policies.DefaultAuthorization)]
public class NotificationsController : BaseJellyfinApiController
{
private readonly INotificationManager _notificationManager;
@@ -83,19 +87,19 @@ namespace Jellyfin.Api.Controllers
/// <summary>
/// Sends a notification to all admins.
/// </summary>
- /// <param name="name">The name of the notification.</param>
- /// <param name="description">The description of the notification.</param>
/// <param name="url">The URL of the notification.</param>
/// <param name="level">The level of the notification.</param>
+ /// <param name="name">The name of the notification.</param>
+ /// <param name="description">The description of the notification.</param>
/// <response code="204">Notification sent.</response>
/// <returns>A <cref see="NoContentResult"/>.</returns>
[HttpPost("Admin")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public ActionResult CreateAdminNotification(
- [FromQuery] string? name,
- [FromQuery] string? description,
[FromQuery] string? url,
- [FromQuery] NotificationLevel? level)
+ [FromQuery] NotificationLevel? level,
+ [FromQuery] string name = "",
+ [FromQuery] string description = "")
{
var notification = new NotificationRequest
{