Adds scaffolding to the CT service

This commit is contained in:
Per Ploug
2015-05-29 09:20:41 +02:00
parent e4eb6363ea
commit 271bc6ba4c
2 changed files with 84 additions and 0 deletions

View File

@@ -89,6 +89,35 @@ function contentTypeResource($q, $http, umbRequestHelper) {
"GetById",
[{ id: id }])),
'Failed to retrieve content type');
},
getScaffold: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"contentTypeApiBaseUrl",
"GetScaffold")),
'Failed to retrieve content type scaffold');
},
/**
* @ngdoc method
* @name umbraco.resources.contentTypeResource#save
* @methodOf umbraco.resources.contentTypeResource
*
* @description
* Saves or update a content type
*
* @param {Object} content data type object to create/update
* @returns {Promise} resourcePromise object.
*
*/
save: function (contentType) {
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostSave"), contentType),
'Failed to save data for content type id ' + contentType.id);
}
};