From f5cf2ffdff4f0ac886ce5f37bbfc5363ae3f2cd6 Mon Sep 17 00:00:00 2001 From: Anders Bjerner Date: Thu, 23 Mar 2017 10:58:10 +0100 Subject: [PATCH] #H5IS Editing a redirect should obviously also work with rootNodeId. --- .../Scripts/Controllers/EditRedirectDialog.js | 1 + .../Controllers/Api/RedirectsController.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Skybrud.Umbraco.Redirects/App_Plugins/Skybrud.Umbraco.Redirects/Scripts/Controllers/EditRedirectDialog.js b/src/Skybrud.Umbraco.Redirects/App_Plugins/Skybrud.Umbraco.Redirects/Scripts/Controllers/EditRedirectDialog.js index faf44e1..acd57ac 100644 --- a/src/Skybrud.Umbraco.Redirects/App_Plugins/Skybrud.Umbraco.Redirects/Scripts/Controllers/EditRedirectDialog.js +++ b/src/Skybrud.Umbraco.Redirects/App_Plugins/Skybrud.Umbraco.Redirects/Scripts/Controllers/EditRedirectDialog.js @@ -60,6 +60,7 @@ var params = { redirectId: $scope.redirect.uniqueId, + rootNodeId: $scope.redirect.rootNodeId, url: $scope.redirect.url, linkMode: 'content', linkId: $scope.redirect.link.id, diff --git a/src/Skybrud.Umbraco.Redirects/Controllers/Api/RedirectsController.cs b/src/Skybrud.Umbraco.Redirects/Controllers/Api/RedirectsController.cs index 78a112d..24f81cd 100644 --- a/src/Skybrud.Umbraco.Redirects/Controllers/Api/RedirectsController.cs +++ b/src/Skybrud.Umbraco.Redirects/Controllers/Api/RedirectsController.cs @@ -122,7 +122,7 @@ public object AddRedirect(int rootNodeId, string url, string linkMode, int linkI } [HttpGet] - public object EditRedirect(string redirectId, string url, string linkMode, int linkId, string linkUrl, string linkName = null) { + public object EditRedirect(int rootNodeId, string redirectId, string url, string linkMode, int linkId, string linkUrl, string linkName = null) { try { @@ -146,6 +146,7 @@ public object EditRedirect(string redirectId, string url, string linkMode, int l url = urlParts[0].TrimEnd('/'); string query = urlParts.Length == 2 ? urlParts[1] : ""; + redirect.RootNodeId = rootNodeId; redirect.Url = url; redirect.QueryString = query; redirect.Link = link;