Update member services to include delete method

This commit is contained in:
Per Ploug
2015-10-12 08:47:09 +02:00
parent edfe91a8b2
commit 1ff1f54769
2 changed files with 28 additions and 5 deletions

View File

@@ -49,6 +49,7 @@ function contentTypeResource($q, $http, umbRequestHelper) {
'Failed to retrieve data for content id ' + contentId);
},
/**
* @ngdoc method
* @name umbraco.resources.contentTypeResource#getAllPropertyTypeAliases
@@ -99,7 +100,18 @@ function contentTypeResource($q, $http, umbRequestHelper) {
"contentTypeApiBaseUrl",
"DeleteById",
[{ id: id }])),
'Failed to retrieve content type');
'Failed to delete content type');
},
deleteContainerById: function (id) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"contentTypeApiBaseUrl",
"DeleteContainerById",
[{ id: id }])),
'Failed to delete content type contaier');
},
/**

View File

@@ -27,7 +27,7 @@ function memberTypeResource($q, $http, umbRequestHelper) {
[{ id: id }])),
'Failed to retrieve property type scaffold');
},
getById: function (id) {
return umbRequestHelper.resourcePromise(
@@ -39,6 +39,17 @@ function memberTypeResource($q, $http, umbRequestHelper) {
'Failed to retrieve content type');
},
deleteById: function (id) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"memberTypeApiBaseUrl",
"DeleteById",
[{ id: id }])),
'Failed to delete member type');
},
getScaffold: function () {
return umbRequestHelper.resourcePromise(
@@ -55,14 +66,14 @@ function memberTypeResource($q, $http, umbRequestHelper) {
* @methodOf umbraco.resources.contentTypeResource
*
* @description
* Saves or update a member type
*
* Saves or update a member type
*
* @param {Object} content data type object to create/update
* @returns {Promise} resourcePromise object.
*
*/
save: function (contentType) {
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("memberTypeApiBaseUrl", "PostSave"), contentType),
'Failed to save data for member type id ' + contentType.id);