Starts fixing up the doc type folders stuff, fixes permissions settings on the trees, adds error messaging for duplicating folders, removes the click handler for folder nodes

This commit is contained in:
Shannon
2015-11-09 18:34:14 +01:00
parent ef94441d3b
commit 4ce0e6bac3
8 changed files with 56 additions and 39 deletions

View File

@@ -11,6 +11,7 @@ using System.Web.Http;
using System.Web.Http.ModelBinding;
using Microsoft.Owin;
using Umbraco.Core;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.WebApi
{
@@ -107,6 +108,22 @@ namespace Umbraco.Web.WebApi
return msg;
}
/// <summary>
/// Creates an error response with notifications in the result to be displayed in the UI
/// </summary>
/// <param name="request"></param>
/// <param name="errorMessage"></param>
/// <returns></returns>
public static HttpResponseMessage CreateNotificationValidationErrorResponse(this HttpRequestMessage request, string errorMessage)
{
var notificationModel = new SimpleNotificationModel
{
Message = errorMessage
};
notificationModel.AddErrorNotification(errorMessage, string.Empty);
return request.CreateValidationErrorResponse(notificationModel);
}
/// <summary>
/// Create a 400 response message indicating that a validation error occurred
/// </summary>