Fix issue when saving Datasets

This commit is contained in:
George Kalampokis 2020-11-02 17:38:19 +02:00
parent 86994c73ce
commit c391cd5521
1 changed files with 3 additions and 3 deletions

View File

@ -624,15 +624,15 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
}); });
} }
onCallbackSuccess(id?: String, saveType?: SaveType): void { onCallbackSuccess(data?: DatasetWizardEditorModel, saveType?: SaveType): void {
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
if (id) { if (data) {
if (saveType === this.saveAnd.addNew) { if (saveType === this.saveAnd.addNew) {
this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'new', this.formGroup.get('dmp').value.id]); }) this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'new', this.formGroup.get('dmp').value.id]); })
} else if (saveType === this.saveAnd.close) { } else if (saveType === this.saveAnd.close) {
this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]); }); this.router.navigate(['/reload']).then(() => { this.router.navigate(['/plans', 'edit', this.formGroup.get('dmp').value.id]); });
} else { } else {
this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', id]); }); this.router.navigate(['/reload']).then(() => { this.router.navigate(['/datasets', 'edit', data.id]); });
} }
} else { } else {
this.router.navigate(['/datasets']); this.router.navigate(['/datasets']);