Skip to content

Commit

Permalink
fix this.schema?.fetchResourceFields is not a function
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <[email protected]>
  • Loading branch information
a110605 committed Oct 22, 2024
1 parent 258da1b commit 0f02fd2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shell/components/CruResource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ export default {
async createResourceYaml(modifiers, resource = this.resource) {
// Required to populate yaml comments and default values
await this.schema?.fetchResourceFields();
if (this.schema?.fetchResourceFields && typeof this.schema.fetchResourceFields === 'function') {
await this.schema?.fetchResourceFields();
}
if ( typeof this.generateYaml === 'function' ) {
return this.generateYaml.apply(this, resource);
Expand All @@ -337,7 +339,9 @@ export default {
async showPreviewYaml() {
// Required to populate yaml comments and default values
await this.schema?.fetchResourceFields();
if (this.schema?.fetchResourceFields && typeof this.schema.fetchResourceFields === 'function') {
await this.schema?.fetchResourceFields();
}
if ( this.applyHooks ) {
try {
Expand Down

0 comments on commit 0f02fd2

Please sign in to comment.