Creates endpoint to create a blueprint
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user