Creates endpoint to create a blueprint

This commit is contained in:
Shannon
2017-06-04 16:00:25 +02:00
parent adb02c96a7
commit 028903c306

View File

@@ -275,6 +275,24 @@ namespace Umbraco.Web.Editors
return false;
}
/// <summary>
/// Creates a blueprint from a content item
/// </summary>
/// <param name="contentId">The content id to copy</param>
/// <param name="name">The name of the blueprint</param>
/// <returns></returns>
public IHttpActionResult CreateBlueprintFromContent(int contentId, string name)
{
var content = Services.ContentService.GetById(contentId);
if (content == null) return NotFound();
var blueprint = Services.ContentService.CreateContentFromBlueprint(content, name, Security.GetUserId());
Services.ContentService.SaveBlueprint(blueprint, Security.GetUserId());
return Ok();
}
/// <summary>
/// Saves content
/// </summary>