Skip to content
Snippets Groups Projects
Commit db7691fe authored by jm's avatar jm
Browse files

#684 delete cesium profile

parent 2f9248da
No related branches found
No related tags found
No related merge requests found
......@@ -318,7 +318,7 @@
"DELETE": "Are you sure you want to <b>delete your cesium+ profile ?</b><br/><br/>This operation is irreversible."
},
"ERROR": {
"REMOVE_PROFILE_FAILED": "deleting profile failed",
"REMOVE_PROFILE_FAILED": "Deleting profile failed",
"LOAD_PROFILE_FAILED": "Could not load user profile.",
"SAVE_PROFILE_FAILED": "Saving profile failed",
"INVALID_SOCIAL_NETWORK_FORMAT": "Invalid format: please fill a valid Internet address.<br/><br/>Examples :<ul><li>- A Facebook page (https://www.facebook.com/user)</li><li>- A web page (http://www.domain.com)</li><li>- An email address (joe@dalton.com)</li></ul>",
......
......@@ -318,7 +318,7 @@
"DELETE": "Are you sure you want to <b>delete your cesium+ profile ?</b><br/><br/>This operation is irreversible."
},
"ERROR": {
"REMOVE_PROFILE_FAILED": "deleting profile failed",
"REMOVE_PROFILE_FAILED": "Deleting profile failed",
"LOAD_PROFILE_FAILED": "Could not load user profile.",
"SAVE_PROFILE_FAILED": "Saving profile failed",
"INVALID_SOCIAL_NETWORK_FORMAT": "Invalid format: please fill a valid Internet address.<br/><br/>Examples :<ul><li>- A Facebook page (https://www.facebook.com/user)</li><li>- A web page (http://www.domain.com)</li><li>- An email address (joe@dalton.com)</li></ul>",
......
......@@ -42,7 +42,7 @@ function ESWalletController($scope, $controller, esModals,csWallet,UIUtils,esPro
UIUtils.alert.confirm('PROFILE.CONFIRM.DELETE')
.then(function(confirm) {
if (confirm){
esProfile.delete(walletData.pubkey)
esProfile.remove(walletData.pubkey)
.then(function () {
$scope.formData.name=null;
$scope.formData.profile = null;
......
angular.module('cesium.es.profile.services', ['cesium.services', 'cesium.es.http.services', 'cesium.crypto.services'])
angular.module('cesium.es.profile.services', ['cesium.services', 'cesium.es.http.services'])
.config(function(PluginServiceProvider, csConfig) {
'ngInject';
......@@ -22,8 +22,7 @@ angular.module('cesium.es.profile.services', ['cesium.services', 'cesium.es.http
get: esHttp.get('/user/profile/:id?&_source_exclude=avatar._content'),
getAll: esHttp.get('/user/profile/:id'),
search: esHttp.post('/user/profile/_search'),
mixedSearch: esHttp.post('/user,page,group/profile,record/_search'),
delete: esHttp.post('/user/profile/_delete/:id')
mixedSearch: esHttp.post('/user,page,group/profile,record/_search')
};
function getAvatarAndName(pubkey) {
......@@ -49,13 +48,6 @@ angular.module('cesium.es.profile.services', ['cesium.services', 'cesium.es.http
});
}
function deleteProfile(pubkey) {
var id = pubkey;
return esHttp.record.remove("user","profile")(id).then(function(res) {
return res;
});
}
function getProfile(pubkey, options) {
options = options || {};
......@@ -399,7 +391,7 @@ angular.module('cesium.es.profile.services', ['cesium.services', 'cesium.es.http
update: esHttp.record.post('/user/profile/:id/_update', {tagFields: ['title', 'description']}),
avatar: esHttp.get('/user/profile/:id?_source=avatar'),
fillAvatars: fillAvatars,
delete: deleteProfile
remove: esHttp.record.remove("user","profile")
};
})
;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment