fix: Add error handling to credential-library creation form

This commit is contained in:
Susmitha Girumala committed 2021-07-22 17:42:37 -04:00
1 parent 123476a3a8
commit a6be658aa5
7 files changed
+67 -50

No files matched your search

@@ -6,7 +6,7 @@ import { fragment } from 'ember-data-model-fragments/attributes';
* Enum options for credential library.
*/
export const options = {
http_methods: ['GET', 'POST'],
http_method: ['GET', 'POST'],
};
export default class CredentialLibraryModel extends GeneratedCredentialLibraryModel {
@@ -15,11 +15,7 @@ export default class CredentialLibraryModel extends GeneratedCredentialLibraryMo
// See the application adapter's error normalization method for
// more information.
@attr('string', {
readOnly: true,
defaultValue: options.http_methods[0],
})
attributes_http_method;
@attr('string', { readOnly: true }) attributes_http_method;
@attr('string', { readOnly: true }) attributes_http_request_body;
@attr('string', { readOnly: true }) attributes_path;
@@ -1,5 +1,6 @@
import Fragment from 'ember-data-model-fragments/fragment';
import { attr } from '@ember-data/model';
import { options } from './credential-library';
export default class FragmentCredentialLibraryAttributesModel extends Fragment {
//= attributes (vault)
@@ -7,6 +8,7 @@ export default class FragmentCredentialLibraryAttributesModel extends Fragment {
@attr('string', {
description:
'The HTTP method the library uses when requesting credentials from Vault.',
defaultValue: () => options.http_method[0],
})
http_method;