diff --git a/client/src/app/features/recipes/recipe-details/recipe-details.component.ts b/client/src/app/features/recipes/recipe-details/recipe-details.component.ts index 2cae7e8..db737db 100644 --- a/client/src/app/features/recipes/recipe-details/recipe-details.component.ts +++ b/client/src/app/features/recipes/recipe-details/recipe-details.component.ts @@ -50,6 +50,9 @@ export class RecipeDetailsComponent implements OnInit { commit_msg :string = ""; + // + department: string = this._route.parent!.snapshot.params['department']; + constructor( private _formBuilder: FormBuilder, private _route: ActivatedRoute, @@ -150,7 +153,7 @@ export class RecipeDetailsComponent implements OnInit { } ); console.log('Sending changes'); - void this._router.navigate(['/recipes']); + void this._router.navigate(['/'+this.department+'/recipes']); })) @@ -167,7 +170,7 @@ export class RecipeDetailsComponent implements OnInit { message: 'Do you want to close without saving?', confirmCallBack: () => { console.log('confirm close'); - this._router.navigate(['/recipes']); + this._router.navigate(['/'+this.department+'/recipes']); }, }; @@ -175,7 +178,7 @@ export class RecipeDetailsComponent implements OnInit { if (this.isValueChanged) { this.showConfirmSaveModal.emit(true); } else { - this._router.navigate(['/recipes']); + this._router.navigate(['/'+this.department+'/recipes']); } } @@ -183,7 +186,7 @@ export class RecipeDetailsComponent implements OnInit { if (this.isValueChanged) { this.showConfirmCloseModal.emit(true); } else { - this._router.navigate(['/recipes']); + this._router.navigate(['/'+this.department+'/recipes']); } }