diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js index f98937759e..98816fe490 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js @@ -667,11 +667,11 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) { }, - createBlueprintFromContent: function(id, name) { + createBlueprintFromContent: function (contentId, name) { return umbRequestHelper.resourcePromise( $http.post( umbRequestHelper.getApiUrl("contentApiBaseUrl", "CreateBlueprintFromContent", { - id: id, name: name + contentId: contentId, name: name }) ), "Failed to create blueprint from content with id " + id diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js index 0ae435ddf1..874577aa1f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js @@ -1,16 +1,15 @@ (function() { - function CreateBlueprintController($scope, - contentResource, - appState, - navigationService, - editorState, - notificationService) { + function CreateBlueprintController( + $scope, + contentResource, + notificationService + ) { - $scope.name = editorState.current.name; + $scope.name = $scope.currentNode.name; $scope.create = function() { - contentResource.createBlueprintFromContent(editorState.current.id, $scope.name) + contentResource.createBlueprintFromContent($scope.currentNode.id, $scope.name) .then(function() { notificationService.showNotification({ type: 3, @@ -26,8 +25,6 @@ [ "$scope", "contentResource", - "navigationService", - "editorState", "notificationsService", CreateBlueprintController ]); diff --git a/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html index 08fc36887a..466ef53ecd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html +++ b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html @@ -5,7 +5,7 @@
Create a blueprint from {{currentNode.name}}
- + diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 0e59124dc9..39a4b850d3 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -281,7 +281,8 @@ namespace Umbraco.Web.Editors /// The content id to copy /// The name of the blueprint /// - public IHttpActionResult CreateBlueprintFromContent(int contentId, string name) + [HttpPost] + public IHttpActionResult CreateBlueprintFromContent([FromUri]int contentId, [FromUri]string name) { var content = Services.ContentService.GetById(contentId); if (content == null) return NotFound();