Skip to content

Commit 6338d57

Browse files
committed
Cherry picked - Removes hard coded api url from rte embed
1 parent 7de1b2d commit 6338d57

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module("umbraco").controller("Umbraco.Dialogs.RteEmbedController", function ($scope, $http) {
1+
angular.module("umbraco").controller("Umbraco.Dialogs.RteEmbedController", function ($scope, $http, umbRequestHelper) {
22
$scope.form = {};
33
$scope.form.url = "";
44
$scope.form.width = 360;
@@ -20,7 +20,7 @@
2020
$scope.form.info = "";
2121
$scope.form.success = false;
2222

23-
$http({ method: 'GET', url: '/umbraco/UmbracoApi/RteEmbed/GetEmbed', params: { url: $scope.form.url, width: $scope.form.width, height: $scope.form.height } })
23+
$http({ method: 'GET', url: umbRequestHelper.getApiUrl("embedApiBaseUrl", "GetEmbed"), params: { url: $scope.form.url, width: $scope.form.width, height: $scope.form.height } })
2424
.success(function (data) {
2525

2626
$scope.form.preview = "";

src/Umbraco.Web/Editors/BackOfficeController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ public JavaScriptResult ServerVariables()
110110
{"manifestAssetList", Url.Action("GetManifestAssetList", "BackOffice")},
111111
{"serverVarsJs", Url.Action("Application", "BackOffice")},
112112
//API URLs
113+
{
114+
"embedApiBaseUrl", Url.GetUmbracoApiServiceBaseUrl<RteEmbedController>(
115+
controller => controller.GetEmbed("",0,0))
116+
},
113117
{
114118
"contentApiBaseUrl", Url.GetUmbracoApiServiceBaseUrl<ContentController>(
115119
controller => controller.PostSave(null))

0 commit comments

Comments
 (0)