23 lines
615 B
JavaScript
23 lines
615 B
JavaScript
import Component from '@glimmer/component';
|
|
import { options } from 'api/models/credential-library';
|
|
import { computed } from '@ember/object';
|
|
|
|
export default class FormCredentialLibraryIndexComponent extends Component {
|
|
// =properties
|
|
/**
|
|
* @type {object}
|
|
*/
|
|
httpMethods = options.http_methods;
|
|
|
|
/**
|
|
* Only allow HTTP request body field if http_method is set to POST.
|
|
* @type {boolean}
|
|
*/
|
|
@computed('args.model.attributes.http_method', 'isSaving')
|
|
get cannotSaveHttpRequestBody() {
|
|
return (
|
|
!this.args.model.attributes.http_method?.match(/post/i) || this.isSaving
|
|
);
|
|
}
|
|
}
|