mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-09 00:43:23 +01:00
api rest call
This commit is contained in:
parent
d1004f2919
commit
31aab0bd48
@ -110,9 +110,7 @@ public class UserManagerImpl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteUser(@NotNull User user) {
|
public void deleteUser(@NotNull final User user) {
|
||||||
final Collaborator collaborator = this.getCollaboratorBy(user.getEmail());
|
|
||||||
getHibernateTemplate().delete(collaborator);
|
|
||||||
getHibernateTemplate().delete(user);
|
getHibernateTemplate().delete(user);
|
||||||
getHibernateTemplate().flush();
|
getHibernateTemplate().flush();
|
||||||
}
|
}
|
||||||
|
@ -159,8 +159,21 @@
|
|||||||
$('#deleteAccountForm').submit(function (event) {
|
$('#deleteAccountForm').submit(function (event) {
|
||||||
|
|
||||||
var locale = $('#deleteAccountForm option:selected').val();
|
var locale = $('#deleteAccountForm option:selected').val();
|
||||||
|
//FIXME: este metodo hay que unificarlo con postChange, con callbacks o eventos para los success and error y pasandole el type
|
||||||
postChange("c/restful/account/locale", locale, 'deleteAccountMsg', "<spring:message code="INFO_UPDATE_SUCCESS"/>");
|
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();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user