From a09abc2fbc69151f0ca750b496ef70536149ac68 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Wed, 23 Oct 2019 13:03:12 +0300 Subject: [PATCH] Fixes bug on redirect if error occurs on opening /datasets/edit/:id (Issue #199) --- .../ui/dataset/dataset-wizard/dataset-wizard.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index b7e5a3980..b361418d0 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -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 => {