CST-12179 Form error now shows failed to edit the service and redirect to the form instead of closing and returning to services directory

This commit is contained in:
Mattia Vianelli
2023-11-02 13:13:11 +01:00
parent 1904befe0e
commit 83ef02c150

View File

@@ -255,16 +255,18 @@ export class LdnServiceFormEditComponent implements OnInit {
this.ldnServicesService.patch(this.service, patchOperations).pipe(
getFirstCompletedRemoteData()
).subscribe(
() => {
this.closeModal();
this.sendBack();
this.notificationService.success(this.translateService.get('admin.registries.services-formats.modify.success.head'),
this.translateService.get('admin.registries.services-formats.modify.success.content'));
}
);
).subscribe((rd: RemoteData<LdnService>) => {
if (rd.hasSucceeded) {
this.closeModal();
this.sendBack();
this.notificationService.success(this.translateService.get('admin.registries.services-formats.modify.success.head'),
this.translateService.get('admin.registries.services-formats.modify.success.content'));
} else {
this.notificationService.error(this.translateService.get('admin.registries.services-formats.modify.failure.head'),
this.translateService.get('admin.registries.services-formats.modify.failure.content'));
this.closeModal();
}
});
}
resetFormAndLeave() {