fix return to recipes

This commit is contained in:
pakintada@gmail.com 2023-12-15 09:32:39 +07:00
parent 3463ca405a
commit b647517ca6

View file

@ -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']);
}
}