description template type editor always navigate to listing after save

This commit is contained in:
amentis 2024-05-10 12:18:32 +03:00
parent eda508a65c
commit be6af23940
1 changed files with 6 additions and 2 deletions

View File

@ -150,7 +150,11 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor<Descripti
this.descriptionTemplateTypeService.persist(formData)
.pipe(takeUntil(this._destroyed)).subscribe(
complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete),
// for each state navigate to listing page
complete => {
this.formGroup = null;
this.router.navigate(['description-template-type'])
},
error => this.onCallbackError(error)
);
}
@ -218,7 +222,7 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor<Descripti
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
this.formGroup.get('status').setValue(DescriptionTemplateTypeStatus.Finalized);
this.persistEntity();
this.formSubmit();
}});
}
}