blob: 38e546b820d4345f68f11462564195444076c227 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import FormView from './form-view';
import {updatePermissionTemplate} from '../../api/permissions';
export default FormView.extend({
sendRequest: function () {
var that = this;
this.disableForm();
return updatePermissionTemplate({
data: {
id: this.model.id,
name: this.$('#permission-template-name').val(),
description: this.$('#permission-template-description').val(),
projectKeyPattern: this.$('#permission-template-project-key-pattern').val()
},
statusCode: {
// do not show global error
400: null
}
}).done(function () {
that.options.refresh();
that.destroy();
}).fail(function (jqXHR) {
that.enableForm();
that.showErrors(jqXHR.responseJSON.errors, jqXHR.responseJSON.warnings);
});
}
});
|