Fixes bug on redirect if error occurs on opening /datasets/edit/:id (Issue #199)

This commit is contained in:
apapachristou 2019-10-23 13:03:12 +03:00
parent b40562f481
commit a09abc2fbc
1 changed files with 2 additions and 3 deletions

View File

@ -133,11 +133,10 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
this.loadDatasetProfiles();
this.registerFormListeners();
// this.availableProfiles = this.datasetWizardModel.dmp.profiles;
},
error => {
this.uiNotificationService.snackBarNotification(this.language.instant('DATASET-WIZARD.MESSAGES.DATAESET-NOT-FOUND'), SnackBarNotificationLevel.Error);
this.router.navigate(['/plans']);
this.router.navigate(['/datasets/edit/' + this.itemId]);
return observableOf(null);
});
} else if (dmpId != null) {
@ -227,7 +226,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
.pipe(takeUntil(this._destroyed)).pipe(
catchError((error: any) => {
this.uiNotificationService.snackBarNotification(error.error.message, SnackBarNotificationLevel.Error);
this.router.navigate(['/explore']);
this.router.navigate(['/datasets/publicEdit/' + this.publicId]);
return observableOf(null);
}))
.subscribe(data => {