wire up get created package by id
This commit is contained in:
@@ -166,8 +166,26 @@ function packageResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
$http.get(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"packageApiBaseUrl",
|
||||
"GetCreated")),
|
||||
"GetCreatedPackages")),
|
||||
'Failed to get created packages');
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.resources.packageInstallResource#getCreatedById
|
||||
* @methodOf umbraco.resources.packageInstallResource
|
||||
*
|
||||
* @description
|
||||
* Gets a created package by id
|
||||
*/
|
||||
getCreatedById: function(id) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"packageApiBaseUrl",
|
||||
"GetCreatedPackageById",
|
||||
[{ id: id }])),
|
||||
'Failed to get package');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
function EditController($location, $routeParams, contentTypeResource, templateResource, stylesheetResource, languageResource, dictionaryResource, dataTypeResource, editorService) {
|
||||
function EditController($location, $routeParams, packageResource, contentTypeResource, templateResource, stylesheetResource, languageResource, dictionaryResource, dataTypeResource, editorService) {
|
||||
|
||||
const vm = this;
|
||||
|
||||
@@ -35,10 +35,11 @@
|
||||
"license": "MIT License",
|
||||
"licenseUrl": "http://opensource.org/licenses/MIT"
|
||||
};
|
||||
|
||||
} else {
|
||||
// load package
|
||||
|
||||
packageResource.getCreatedById(packageId).then(createdPackage => {
|
||||
vm.package = createdPackage;
|
||||
}, angular.noop);
|
||||
}
|
||||
|
||||
// get all doc types
|
||||
|
||||
Reference in New Issue
Block a user