Skip to content

Commit

Permalink
fix: import api env validate
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Mar 3, 2023
1 parent 43003b5 commit d6595ec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FeatureInfo } from 'eo/workbench/browser/src/app/shared/models/extensio
import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service';
import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message';
import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service';
import { parseAndCheckCollections } from 'eo/workbench/browser/src/app/shared/services/storage/db/validate/validate';
import { parseAndCheckCollections, parseAndCheckEnv } from 'eo/workbench/browser/src/app/shared/services/storage/db/validate/validate';
import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service';
import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service';
import { Subject } from 'rxjs';
Expand Down Expand Up @@ -124,10 +124,12 @@ export class ImportApiComponent implements OnInit {
try {
console.log('content', content);
const collections = parseAndCheckCollections(data.collections);
const environmentList = data.environmentList.filter(n => parseAndCheckEnv(n).validate);
const [result, err] = await this.apiService.api_projectImport({
...{
...data,
collections
collections,
environmentList
},
projectUuid: this.store.getCurrentProjectID,
workSpaceUuid: this.store.getCurrentWorkspaceUuid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class EnvEditComponent implements OnDestroy, TabViewComponent {
this.model = {
name: '',
hostUri: '',
parameters: []
parameters: '[]'
};
this.initialModel = eoDeepCopy(this.model);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"name": {
"type": "string"
},
"parameters": {},
"parameters": {
"type": "string"
},
"projectUuid": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export interface Environment extends StorageModel {
/**
* Env parameters
*/
parameters?: Array<{ name: string; value: string; description: string }>;
parameters?: string;
}

/**
Expand Down

0 comments on commit d6595ec

Please sign in to comment.