mirror of
https://github.com/haiwen/seahub.git
synced 2025-06-30 08:53:49 +00:00
28 lines
772 B
HTML
28 lines
772 B
HTML
$('#group-add-submit').click(function() {
|
|
$.ajax({
|
|
url: '{{ post_url }}',
|
|
type: 'POST',
|
|
dataType: 'json',
|
|
cache: 'false',
|
|
beforeSend: prepareCSRFToken,
|
|
data: {
|
|
'group_name': $('#group_name').val()
|
|
},
|
|
success: function(data) {
|
|
if (data['success']) {
|
|
location.reload(true);
|
|
} else {
|
|
apply_form_error('group-add-form', data['error']);
|
|
}
|
|
},
|
|
error: function(data, textStatus, jqXHR) {
|
|
var errors = $.parseJSON(data.responseText);
|
|
$.each(errors, function(index, value) {
|
|
apply_form_error('group-add-form', value[0]);
|
|
});
|
|
}
|
|
});
|
|
|
|
return false;
|
|
});
|