mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
api rest call
This commit is contained in:
parent
4f40431d55
commit
88fed0af0a
@ -110,9 +110,7 @@ public class UserManagerImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUser(@NotNull User user) {
|
||||
final Collaborator collaborator = this.getCollaboratorBy(user.getEmail());
|
||||
getHibernateTemplate().delete(collaborator);
|
||||
public void deleteUser(@NotNull final User user) {
|
||||
getHibernateTemplate().delete(user);
|
||||
getHibernateTemplate().flush();
|
||||
}
|
||||
|
@ -159,8 +159,21 @@
|
||||
$('#deleteAccountForm').submit(function (event) {
|
||||
|
||||
var locale = $('#deleteAccountForm option:selected').val();
|
||||
|
||||
postChange("c/restful/account/locale", locale, 'deleteAccountMsg', "<spring:message code="INFO_UPDATE_SUCCESS"/>");
|
||||
//FIXME: este metodo hay que unificarlo con postChange, con callbacks o eventos para los success and error y pasandole el type
|
||||
jQuery.ajax("c/restful/account", {
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
data: locale,
|
||||
type: 'DELETE',
|
||||
contentType: "text/plain; charset=utf-8",
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
window.location.href = "/c/logout"
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$('#' + 'deleteAccountMsg').removeClass('alert-info').addClass('alert-error').show();
|
||||
$('#' + 'deleteAccountMsg').text(textStatus);
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user