Files
Umbraco-CMS/src/Umbraco.Web/Editors/PublishedStatusController.cs

29 lines
916 B
C#
Raw Normal View History

2017-10-31 12:48:24 +01:00
using System;
using System.Web.Http;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Editors
2017-10-31 12:48:24 +01:00
{
public class PublishedStatusController : UmbracoAuthorizedApiController
{
private readonly IPublishedSnapshotService _publishedSnapshotService;
public PublishedStatusController(IPublishedSnapshotService publishedSnapshotService)
{
_publishedSnapshotService = publishedSnapshotService ?? throw new ArgumentNullException(nameof(publishedSnapshotService));
}
[HttpGet]
public string GetPublishedStatusUrl()
{
if (!string.IsNullOrWhiteSpace(_publishedSnapshotService.StatusUrl))
{
return _publishedSnapshotService.StatusUrl;
}
2017-10-31 12:48:24 +01:00
throw new NotSupportedException("Not supported: " + _publishedSnapshotService.GetType().FullName);
2017-10-31 12:48:24 +01:00
}
}
}