Fixes UI error when there is an unathorized request, fixes NotificationService to accept IContent since that's all it supports

This commit is contained in:
Shannon
2018-10-25 00:28:37 +11:00
parent 81c7a1de78
commit b716ed1964
4 changed files with 7 additions and 16 deletions

View File

@@ -66,17 +66,11 @@ namespace Umbraco.Core.Services.Implement
/// <param name="siteUri"></param>
/// <param name="createSubject"></param>
/// <param name="createBody"></param>
/// <remarks>
/// Currently this will only work for Content entities!
/// </remarks>
public void SendNotifications(IUser operatingUser, IEnumerable<IUmbracoEntity> entities, string action, string actionName, Uri siteUri,
public void SendNotifications(IUser operatingUser, IEnumerable<IContent> entities, string action, string actionName, Uri siteUri,
Func<(IUser user, NotificationEmailSubjectParams subject), string> createSubject,
Func<(IUser user, NotificationEmailBodyParams body, bool isHtml), string> createBody)
{
if (entities is IEnumerable<IContent> == false)
throw new NotSupportedException();
var entitiesL = entities as List<IContent> ?? entities.Cast<IContent>().ToList();
var entitiesL = entities.ToList();
//exit if there are no entities
if (entitiesL.Count == 0) return;