U4-8416 Empty recycle bin does not refresh or gives feedback to user

This commit is contained in:
Shannon
2016-06-27 18:27:49 +02:00
parent 374fa5b574
commit 0e61eb79a8
7 changed files with 83 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using System.Web.Http.ModelBinding;
using System.Web.Http.Results;
using Microsoft.Owin;
using Umbraco.Core;
using Umbraco.Web.Models.ContentEditing;
@@ -124,6 +125,22 @@ namespace Umbraco.Web.WebApi
return request.CreateValidationErrorResponse(notificationModel);
}
/// <summary>
/// Creates a succressful response with notifications in the result to be displayed in the UI
/// </summary>
/// <param name="request"></param>
/// <param name="successMessage"></param>
/// <returns></returns>
public static HttpResponseMessage CreateNotificationSuccessResponse(this HttpRequestMessage request, string successMessage)
{
var notificationModel = new SimpleNotificationModel
{
Message = successMessage
};
notificationModel.AddSuccessNotification(successMessage, string.Empty);
return request.CreateResponse(HttpStatusCode.OK, notificationModel);
}
/// <summary>
/// Create a 400 response message indicating that a validation error occurred
/// </summary>