- this.dialogRef.afterClosed().subscribe(result => {
- if(result == undefined || result == null){
- console.log("dialogbox is closed");
- }else{
- this.catalog.modelName=result['modelName'];
- this.catalog.derivedFrom=result['derivedFrom'];
- this.catalog.definitionType=result['definitionType'];
- this.catalog.definition=result['definition'];
- this.catalog.tags=result['tags'];
- this.catalog.updatedBy=result['updatedBy'];
- console.log(this.catalog);
- this.catalogCreateService.saveCatalog(this.catalog)
- .subscribe(response=>{
- this.alertService.success("save success"+ response)
- },
- error=>{
- this.alertService.error('Error saving resources');
- })
- }
- });
+ this.dialogRef.afterClosed().subscribe(result => {
+ if(result == undefined || result == null){
+ console.log("dialogbox is closed");
+ }else{
+ this.catalog.modelName=result['modelName'];
+ this.catalog.derivedFrom=result['derivedFrom'];
+ this.catalog.definitionType=result['definitionType'];
+ this.catalog.definition=JSON.parse(result['definition']);
+ this.catalog.tags=result['tags'];
+ this.catalog.updatedBy=result['updatedBy'];
+ this.catalog.description= "";
+ this.catalog.version= "";
+ this.catalog.creationDate="";
+ console.log(this.catalog);
+ let catalogState = {
+ catalog: this.catalog,
+ isLoadSuccess: true,
+ isUpdateSuccess:true,
+ isSaveSuccess:true
+ }
+ this.store.dispatch(new SetCatalogState(catalogState));
+ this.catalogCreateService.saveCatalog(this.catalog)
+ .subscribe(response=>{
+ this.alertService.success("save success"+ response)
+ },
+ error=>{
+ this.alertService.error('Error saving resources');
+ })
+ }
+ });
+ }